summaryrefslogtreecommitdiff
path: root/dev/lsp
Commit message (Collapse)AuthorAge
* lsp_client: SPC l a passes the server's own diagnostics that touch the caret ↵Gabriel Schneider24 hours
| | | | | | | back in the request's context, as the protocol has it (CodeActionContext.diagnostics), so a quick fix a server offers for a diagnostic alone comes (VIDEO2's B8, agent V5: on clangd's error at V8's src/torque/types.cc:163:53, `b.ToString()` with `b` a pointer, `SPC l a` answered `CodeAction: not found` even 5 s after landing, where Helix, LazyVim and Doom list `change '.' to '->'` first); THE CAUSE: the codeAction request sent `"context":{"diagnostics":[]}` (dev/lsp/lsp_client.zig:1078), and clangd offers its fix-its only for the diagnostics a client passes back; THE FIX: the request carries, as the server gave them, the diagnostics whose range holds the caret (start <= caret <= end, the server's columns on both sides), read as `]d` reads them: pulled when the server pulls (LSP 3.17), else its last publish, waited for up to diag_ms when a didChange postdates it; that read is one function now (diagnosticsOf, the old `diagnostics` and renderStore's per-file branch folded into it; its values own their strings, the store's copy may go while the mutex is let go); a pulling server costs one textDocument/diagnostic round trip more per SPC l a; no core, dump, digest, frame or hot path touched (a language server's worker); RUN (TEST FIRST): test/lspmock.zig gains LSPMOCK_MODE=push (clangd's way: no diagnosticProvider, one error published at each didOpen and didChange) and offers `change '.' to '->'` first for each diagnostic passed back; behaviour/language_servers.zig "SPC l a passes back the server's own diagnostics at the caret ..." makes the mock C's server in that mode, opens main.c at the `.` of `return b.n;`, and asks `▶ 1 change '.' to '->'` and its digit giving `b->n`: fails on ab9fa40a7bbb (`not on the screen: ▶ 1 change '.' to '->'`, the rows the mock's three), passes now; the existing SPC l a test (a pulling server, the caret off its diagnostic) lists the same three rows; a user hit it on every clangd fix-it (and any server whose quick fixes hang on a diagnostic: rust-analyzer's, gopls's); the real check (clangd 23.1.5, this tree's Debug tui in a private session, .scratch/walkui/CA/demo): see CA's report; GATES (Debug tui): behaviour-test language-servers 14/14, the whole 290/290 (+1), core-test 1172/1347 (175 skipped, as on the base); load 2.5 to 12.4 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
*-. merge (M2): W3+W3b lean chrome (krwnyllv 027c96360928) + L2cde/L2b/L3457 ↵Gabriel Schneider34 hours
|\ \ | | | | | | | | | | | | | | | | | | colour and themes with W4 (ryuzknor 14723377a8d1) + W6 Symbols by kind (pnmuqkop 8393c24f7667) + W78/T1/T23 previews, root search, the shell's prompt, a server started on open, kbdin's path (xuwpnwno 849542a05f7b), resolved: THE CODE: core/Pick.zig and test/behaviour/language_servers.zig, each side's tests appended at the file's end (W6's Symbols tests and W78's W8 test; W6's server Symbols test and T2's start-on-open test); core/colors.zig, where L2b took `hit` and `hit_current` out of Roles and W6 put `kind` beside them: W6's mark ink moves onto the chrome, `Chrome.Inks.kind`, the keyword held to 4.5:1 on each ground and on that ground's selection (a list's cursor row), worked out by groundInks at a theme change as the key and match inks are (DESIGN.md B4, B1.3), and draw.zig's band draws a row's kind mark in the focused or the plain tag's `kind` (`p.chrome().on(...)`, the band's other inks still Roles' until L2a), Roles.kind and its floor check gone; the ring's per-ground check (ringFailures' `inks`) holds it to 4.5:1 on its ground and its selection where the keyword's hue reaches it there (a hue held to the end of light keeps a trace of itself: #000100 on solarized_dark's grey tag and its selection reads 4.49, papercolor_light's page under its dark selection 3.33; held to pure black's reach those two failed); Pick.zig's Symbols test asks the mark in `p.chrome().on(.focus).kind`; test/soak.py's safe_tags wrote the old window words to /tag, which since K'2 appends them after the computed `Find Grep Newcol Help Exit` (a doubled row, and Exit, computed, not taken away): it writes `Joincol Themes`, the old safe tag's words the row no longer computes; THE GOLDENS: the 40 in conflict (14 on L2b's tree, 40 once L3457's 37 came in) re-recorded once with `process-test -- --update` (the whole run before it failed on exactly those 40; no other golden moved) and each read against both sides and their common base (ymkwwwnn) by .scratch/walkui/M2/gcmp.py, g9p.py and galign.py: text rows, and every changed cell's style pair explained by the other side's base-to-side pairs (its ink and its ground each): lean's words and rows on every snap (`text == A` wherever the other side moved no text), every colour the other side's (L2b's hits, chip, secondary selection, diff grounds, guides, sweeps; L3's focused name tint #dfbce5 to #ecc8f2, resting grip #496656 to #465a43, column grip #887455 to #504733), 0 cells unexplained; the other sides' text at lean's rows: W4's `l Lists` in find's SPC f level and its `C-o back to ...` notes (find, fsearch), W78's preview spines (find), W6's marked, grouped symbols (lsp: `f helper`, `f main`, `c std`, the preview landing on helper's line 3), T1's `$` kept (ttyhelp's leaderworks, row 2) and W4's Resume doc at the +Help's foot (ttyhelp), L5's ring (theme: five new snaps, dark, light, mono, okabe, sepia; themesel: every step's rows and styles L3457's row for row, one row up under K'2, only the rail thumb's cells moved, the panes one row taller); tagnav's Themes list shows in neither lean's recording nor the merge's (the window row's click lands on Dump there); the 9P captures (collapse, mini, ninep) read the same way; no merge fault found; GATES: core-test 1155/1329 (174 skipped), the ring 245 of 245 themes with no expected failure; process-test 0 of 149 failed (3 skipped) after the re-record; load 0.8 to 7.1 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
| | * Lsp, lsp_client, File, dump: a file of a language a server speaks, opened in ↵Gabriel Schneider37 hours
| |/ |/| | | | | | | | | | | a pane (a Look, a landing, a walk step, the boot's file, a restored session's), starts that server and tells it of the file on a worker of its own, so the file's first question finds it ready (agent V4's find for the comparison video, VIDEO2/STORY.md §4.1 and §10.2: pardes's first `gd` cost about 2.5 s where Helix's, LazyVim's and Doom's cost 0.05 s; the user was asked, the default yes); THE CAUSE: dev/lsp/lsp_client.zig spawned a server on the first query that needed it (its header's lifecycle), and that query paid the spawn, the handshake and the server's first parse of the file; THE FIX: an effect `lsp_open`, emitted beside the file's watch by File.open (look.open, Trail's step, the boot document) and dump.revivePane (a restored or upgraded session), performed through a Host entry `lsp_open` (tui, gui and macOS: Inbox.openLsp; not held for `threads_ok`: the boot's file and a restored session's are opened before the loop's threads start); dev/Lsp.zig `open` asks nothing for a file no spec speaks for (lsp.speaks, on the loop), else copies the pane's file (`snapshot`) and hands it to a worker of its own (`Opener`, one at a time: a file opened while one is under way is let go and told at its first query, syncDoc; one done is awaited, at once, before the next), which calls lsp_client.open: a spec disabled asks nothing, a binary not found disables the spec without a word (its first query says `language server for .py not found`, not every file opened), else `ensure` (the server started as a query starts it, `starting` and `ready` narrated as before, one per spec) and `syncDoc` (didOpen); nothing in the query log; not through Lsp.start (its cancel and join of the query in flight waits out a protected handshake, up to init_ms = 8 s, on the loop) nor `work` (the queries' one fixed region, memory.takeLspQuery); a picker's preview (Pick.preview, no pane) and a 9P `ctl get` (ninep/ctl.zig getFile, no File.open) start none; Lspinfo says `not started yet (a file of its opened starts it)`; docs/typ/setup.typ and reference.typ say when a server starts; THE HARNESSES (the coordinator's ruling: no test starts a server of this machine's): PARDES_LSP_OPEN=off starts none and is the process harnesses' default (test/process.zig's child environment, test/tty.zig, and test/fs.py, selfmount.py and daemon.py's base_env), so the `lsp` tty cases' zls is started by their first query as before; a test binary (builtin.is_test) starts none unless it says `on`, as the behaviour harness's language sessions do (Session.initLanguage, every spec the mock or off, `.lsp_open` drained as a host performs it, awaited); RUN (TEST FIRST): behaviour/language_servers.zig "a file of a server's language opened in a pane starts that server and tells it of the file, with no query asked; a picker's preview of one starts none, a second file no second server, and a server not installed is found silently" previews a.zig in Find's picker (Lspinfo: zls `not started yet`), opens it (zls `ready`, `docs 1`, the query count unchanged), opens b.zig (`docs 2`: the same server), and opens c.py and d.py with PARDES_LSP_PY naming no binary (pyright `disabled`, no query, nothing on the screen): fails on the base at language_servers.zig:367 (zls not started by the open), passes now; lsp_client.zig "a file opened whose server is not installed disables it without a word ..." opens two .py files with a status sink set: the spec disabled, no word posted, a query then `not found`; MEASURED (.scratch/walkui/T23/measure-v8.sh: VIDEO's probe.py, the screen polled every 50 ms, this change's Debug tui, a reflink copy of VIDEO2's V8 tree with clangd and its 27-file compile database, torque-parser.cc opened, `743ggfI` then `gd` 4 s after the start, until utils.h's `bool IsUpperCamelCase` shows): with PARDES_LSP_OPEN=off (the base's way) 1.97, 1.98, 1.97 s; started at the open 0.05, 0.05, 0.05 s; on VIDEO's tally with zls (measure.sh) both ways 0.05-0.10 s (zls starts and answers within one poll there); a user hit it on the first question of every file of a session's languages, about 2 s with clangd over a real project; NEW HOT PATHS: none per key or frame; per file opened, one effect more and on the loop lsp.speaks (the spec table's extensions); for a file a spec speaks for, a copy of its text (the snapshot a query makes) and a worker started; GATES: core-test 1130/1304 (174 skipped: +1), shell-test 1352/1355 (3 skipped: +1), pane-test 183/184, behaviour-test 286/286 (+1) and --replay 20 seeds of 70 steps, 0 failures, process-test 0 of 147 failed (3 skipped), term-test 17/17, kitty-test 45/45; the wire's semantics move (a Host entry, tape.shape); no dump change (effects are local, not dumped); the soak `replicas -- --clients 5 --rtt 30,80,207` dies on the base too (5dab435d7262, run here: `allocator leaks detected` at seed 0 rtt 80, MuPDF's allocations of documents a picker previewed, Pick.showKind), so run without the pdf addon (its binary, `--addon` image and life): diverged 0, unequal 0, quiet checks 468/0 251/0 657/0, stops not on may_wait 0, the corpus 22 of 22 scenes the same, no leak (a first run had one key stop at `spawn` at seed 3 rtt 80, exec.zig's rerun of a command pane, which emits a spawn with no `open a terminal` stop; the base's run and a second run had none); the gui unit-test run once, on T3's change over this one (its description); no frame or perf gate (the user's rule of 2026-11-26); load 1.1 to 9.1 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
| * lsp_client, Output, lspmock, syntax, Pick, Query, docs: the Symbols builtin ↵Gabriel Schneider39 hours
|/ | | | | | | (a language server's documentSymbol) gives the Symbols picker's marks and order (UX DESIGN N, binding: "The builtin `Symbols` keeps reading the server but gets the same mark, order and qualified names, from `SymbolKind`"): walkSymbols keeps each symbol's SymbolKind, mapped onto N2's kinds (5 Class, 10 Enum, 11 Interface, 23 Struct, 26 TypeParameter a type; 6 Method, 9 Constructor, 12 Function, 25 Operator a function; 7 Property, 8 Field, 22 EnumMember a field; 14 Constant a const; 13 Variable, 15 to 21 and 24 a var; 1 File to 4 Package a module; any other the other), and names each in the ones it is in (a DocumentSymbol's nesting, a SymbolInformation's `containerName`): a row is `shapes.rs:5:5-8 m Shape.side`, the rows types, functions, fields, then the rest, each in the server's order; the +Search keeps that order: a file's symbols are neither sorted by their places (Output.sortResults) nor laid out as Locations, which put a file's rows in their lines' order (Output.usesLocationsConfig): a row each, as the picker lists them; the walk's list picker (`Jumps walk`, Ask's) takes them in that order (tty `lsp` with zls: `f helper`, `f main`, `c std`, was `std`, `helper`, `main`); an index's Symbols (SCIP, dev/lsp/Scip.zig) keep their rows unmarked, one row each now too; the mock answers documentSymbol with a nested list in no kind's order (a const, a function, a struct with a field and a method, an enum with a member, a module); docs/typ guide's `Symbols name` and the reference's Symbols say the marks and the order; and three faults of the change before's rows, which its pictures showed (each TEST FIRST: the syntax.zig and Pick.zig tests failed with them first; the pattern guard came with its JavaScript case, not before it): a test whose name is longer than 200 bytes was no symbol, so its body was no scope and its local structs and functions were listed as types and functions (Pick.zig's own tests: `t typeIn = struct`): a name that long is cut, on a character, and a test's body lists nothing (370 rows of core/Pick.zig to 247); a name field is taken whole when it is one line (C++'s `namespace v8::internal::torque` named `v8`, now whole; a value binding's must still be a name, never a pattern: `const { x, y } = a`, OCaml's `let () =`); the qualifier dimmed in a row ran to the name's last `.`, a test's sentence's (`(SPEC §6.3, §7.3)` dimmed most of it): it is the candidate's `base` now, the qualifier's length from the gather, which also gives the scorer its basename bonus on the name; core/root.zig's import of syntax.zig (the change before) says what it does: without it a -Dtest-filter run compiles none of syntax.zig's tests, while a whole run has them (core-test 1135/1308 with it or without it; the change before said they ran nowhere: wrong); RUN (TEST FIRST): test/behaviour/language_servers.zig "language-servers: a server's Symbols are the Symbols picker's rows ..." opens shapes.rs with no index (the server asked) and asks the +Search's rows in that order: with walkSymbols' marks alone they came in their lines' order (`c LIMIT`, `f main`, `t Shape`, ...: the sort and the Locations layout), passes now; the index's Symbols test asks one row each (`lib.rs:1:11-15 Shape`); test/snapshots/lsp.golden re-recorded: only its symbols snap's three rows (marked and grouped) and the preview landing on their first, `helper`'s line 3; GATES on this stack (the change before under it): core-test 1135/1308 (173 skipped; base 1127/1301 with the base's one failure, a CPU-time test under load: colors' "the whole ring resolves in 150 ms"), shell-test 1356/1359 (3 skipped), pane-test 183/184 (1 skipped), behaviour-test 281/281 and --replay 281/281, process-test 1 of 147 failed (tty editing: lsp, its golden: re-recorded, the ten `tty editing: lsp` cases 0 of 10 failed), term-test 17/17, kitty-test 45/45; the dump fuzz (Names.Cand.group, Stream.Batch.symbols) at 40,000 join seeds twice and 1,779 image seeds 13/13; the soak `replicas -- --clients 5 --rtt 30,80,207`: diverged 0, unequal 0, quiet checks 421/0 415/0 590/0, unlisted stops 0, the corpus 22 of 22 scenes the same, no leak; the gui unit-test 1960/1964 (4 skipped; its one failure the perf check's BaselineHarnessMismatch, every base's); core-test, shell-test, pane-test and behaviour-test again after the three faults: the same counts; the pictures (the S kit at 26 px, neonotte84, 100x30, typed through the pty; .scratch/walkui/W6/png): today's install (install74) beside this tree's Debug gui, SPC s s on core/Pick.zig (today 127 rows of declarations, `pub fn deinit(...` first; here 247, `t Pick = @This()` first, the types, then the functions ...) and on V8's torque-parser.cc (today 132, here 273 under `v8::internal::torque.`), and `count` typed (today the cursor on `count`, then `paneCount` and every row whose signature holds c-o-u-n-t, `[]const u8` among them; here `f count` current, `f paneCount`, `c counts_zig`, then the tests whose sentences match); no frame or perf gate (the user's rule of 2026-11-26); load 3.0 to 14.2 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
* lsp_client, Ask, Pick, body_layer: code actions as a picker (walk UI P3 item ↵Gabriel Schneider3 days
| | | | | | | 1, SPEC §5.1 "actions", §14.1, POLISH 17): the client sent each action's title alone (lsp_client run `.code_action`), so `SPC l a` could only list them in a +Lsp, nothing to preview or apply; NOW the client writes each action's row and after it its edit of this file as `@put` records (actionEdits, sorted, sharing renameEdits' WorkspaceEdit reading as editFiles), `@elsewhere` for an edit that reaches another file or makes one (never a part of it applied), none for a command's; an action the server sent without its edit but with `data` is asked for it with codeAction/resolve when the server says resolveProvider (Caps.resolve_actions); typed where jumps walk (Ask's `ghost`, recorded at ask time as the hover's) the answer is Pick's new source `actions` in the asking pane's own tag (`␣ l a Actions`, its host the edited pane as the themes picker's), each row its digit in the key ink then the title (the query matches the title), the body moved to the edit's first line while it is under the cursor and showing its edit as ghost rows (Pick.ghosts, drawn after Prompt.ghosts by the body layer: the lines it changes on the Changes layer's deleted ground, what they become after them on the added ground, the rows below pushed down; R3, DESIGN D4 add/del; bounded by the rows shown), Enter or `1`-`9` with the field empty applies it as one undo step through Ask.applyAction (applyLspEdits, of the revision it was asked of: Pick.revision), the tag at rest first; a command's or an elsewhere edit is said, not applied; anyone else's (a 9P script) keeps the +Lsp of titles; the mock (test/lspmock.zig) answers three actions: a title alone, one with its edit (a line put in at the top), one resolved (main.rs's two `add` calls to `sum`); CodeAction's doc and the builtins json say so; TESTS: core/Pick.zig "code actions: a picker in the asking pane's tag ..." (ghost rows and grounds rendered, `3` applies, `u` undoes, a command's said), test/behaviour/language_servers.zig "SPC l a lists the server's code actions in the pane's tag by their digits ..." (through the mock end to end, resolve included; on the base `SPC l a` makes a +Lsp); core-test 1063/1233 (170 skipped), behaviour-test 279/279, shell-test's edit tests 89/89 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
* tui: a pardes whose terminal hangs up (no daemon) or that is sent SIGTERM ↵Gabriel Schneider7 days
| | | | | | | kills its language servers' groups as an exit does: Killed.handle dies by raise, so the language client's atexit group kill (lsp_client.zig killAllAtExit) never ran and a server busy in a build (zls at a cold start, its children) lived on after the editor; the handler calls it now (kill(2) only, async-signal-safe); test "tty editing: lsp-hangup" (the mock, LSPMOCK_MODE=busy, leaves a child in its group at the handshake and says its pid; the case hangs up the pty and wants the child gone in 5 s): ServerChildLivesOn on the base, passes now; a user could hit it: closing the terminal of a daemon-less pardes, or kill (TERM) of any pardes, with a language server busy; tui process-test 1 of 145 failed once in the whole run (the SIGTERM flags case, "the terminal left raw", load 8-15; 3 of 3 alone) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* lsp: "still loading the workspace" is said only when the server says it, so ↵Gabriel Schneider8 days
| | | | | | | lspcomplete and lspcompletemoved pass: an empty answer inside the 250 ms after the server's initialize waits out that window for a progress notification and asks again, which stays, but it also posted "<server> is still loading the workspace; the answer comes when it is done…" whether or not the server had said anything (`starting` alone, dev/lsp/lsp_client.zig:785), and zls says nothing, so the message was false and stayed on the message row after the (empty, right) answer; a Tab in a comment, the tests' first query, always lands in that window, so both failed on every base (their goldens' only difference); now the message and the trace's note need `c.loading` or `c.progress > 0`; a user saw it on the first completion after zls started; after, both 0 of 35 runs under load 46-65 (15 more lost to a cache wipe) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* dev: the frontends (dev/tui, dev/gui, the macOS app's Swift and resources in ↵Gabriel Schneider9 days
dev/macos), host_io, file_watch, fonts, the lsp client and Scip, Art, jump_trail, glide and vaxis_input into dev/ (the reorganisation's tree, step 2b): module `dev` (dev/root.zig) beside the core and the runtime, each naming the others; the window wired into it, sketchbook's devices imported as `sketchbook` (its `dev` would be ours); pardes.zig keeps its re-exports (host_io, file_watch, glide, fonts) so every caller reads as before; core-test and shell-test run the devices' test program too, so the same tests run (the ledger, tui and gui); nothing else changes: frames byte-identical, replicas and process-test the base's Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T