diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 10:45:48 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 10:57:08 -0300 |
| commit | 856bf4a8ed36cc6ec38dc9001f753a8838106da2 (patch) | |
| tree | 22e170f5b738935bb474dc350ddb02131a866680 | |
| parent | e6a9e2a3bbc5954d2c562019b3ce2983bb98b9cc (diff) | |
| download | pardes-856bf4a8ed36cc6ec38dc9001f753a8838106da2.tar.gz pardes-856bf4a8ed36cc6ec38dc9001f753a8838106da2.zip | |
lsp: the in-process ZLS backend's last traces go: Lspinfo's +Lsp starts with its language servers (`language servers:`), where it said `backend: lsp-client` and `protocol servers (lsp-client):` from when Zig files had a backend of their own, and lsp.backend_name with it (lspbench's report and the tests that quoted the line follow); docs/lsp-evaluation.md's decision says what the tree is, one protocol client for every language, zls found on PATH, and what a user must install
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
| -rw-r--r-- | docs/lsp-evaluation.md | 55 | ||||
| -rw-r--r-- | src/CHANGELOG.md | 3 | ||||
| -rw-r--r-- | src/lsp/lsp.zig | 3 | ||||
| -rw-r--r-- | src/lsp/lsp_client.zig | 2 | ||||
| -rw-r--r-- | src/ninep/ctl.zig | 2 | ||||
| -rw-r--r-- | test/lspbench.zig | 3 | ||||
| -rw-r--r-- | test/process/builtins.zig | 4 | ||||
| -rw-r--r-- | test/snapshots/lspdebug.snap | 3 |
8 files changed, 37 insertions, 38 deletions
diff --git a/docs/lsp-evaluation.md b/docs/lsp-evaluation.md index 6aa58409..0812ebf0 100644 --- a/docs/lsp-evaluation.md +++ b/docs/lsp-evaluation.md @@ -2,7 +2,8 @@ Same core, same seam (`src/lsp/lsp.zig`), same harness (`zig build lspbench`) over the same corpus — 17 probes at the time, 22 today. Three jj workspaces, -three independent implementations, one function each. C landed; see +three independent implementations, one function each. C landed first and +went in 0.6; the tree has B's kind of client alone, for every language. See **Decision** below. > **This is a dated report, not a description of the tree.** Every MEASUREMENT @@ -10,7 +11,8 @@ three independent implementations, one function each. C landed; see > because renumbering a comparison nobody can re-run turns a record into a > guess. What has moved since, re-checked 2026-08-26: `lspbench` now has **22** > probes rather than 17 (the dot-completion work added five), -> `src/lsp/lsp_zls.zig` has grown from 540 lines to **1 432**, +> `src/lsp/lsp_zls.zig` had grown from 540 lines to **1 432** (1 522 when it +> went, 2026-09-29), > `test/snapshots/` holds **95** scripts rather than 56 (`.snap` + `.golden` > pairs), and the differential suites are `hxdiff` **481** (`cases.jsonl`) and > `hxparity` **561** (`cases.jsonl` + the 80 editing extras in @@ -98,34 +100,33 @@ real binary through the helix keymap, and pass `hxdiff` (360) and `hxparity` ## Decision -**C landed.** It is what `src/lsp/lsp_zls.zig` is, and ZLS is now a fetched -dependency (`build.zig.zon`, pinned to commit `3e0d0820` on the 0.16.x branch) -so it sits in `zig-pkg/` like everything else and the build is reproducible -from the .zon alone — no path dependency on a local checkout. The same commit -is spelled a second time in `build.zig` as `const zls_version = -"0.16.1-dev+3e0d0820"`, for ZLS's own `-Dversion-string`; the semver half -exists nowhere in the manifest, so the duplication cannot be removed, but a -`comptime` block beside the constant `@compileError`s unless the two name the -same commit. See `docs/typ/building.typ`. +**One protocol client, for every language, Zig's included.** C landed first +(`src/lsp/lsp_zls.zig`, ZLS a fetched dependency pinned in `build.zig.zon`). +The multi-language argument below won on 2026-09-01, when a protocol client, +`src/lsp/lsp_client.zig`, arrived beside it, and on 2026-09-29 (change +`kvlpprms`, released in 0.6) the in-process backend went: Zig files ask a +`zls` found on `PATH` as every other language asks its server, the ZLS +source and its build wiring left the tree, and the binaries shrank (ReleaseFast +105.35 to 96.28 MB, Debug 296.5 to 245.9 MB, measured then; the table's ++35 MiB was C's over the base it was built on). The last trace of the two +backends, Lspinfo's `backend: lsp-client` line, went on 2026-11-05. -A and B were not deleted, only un-worktree'd. They remain whole commits: +The client is not `stuurqqt` resurrected: B pumped the socket only while a +query waited, which cannot carry an indexing server's `$/progress` or +unsolicited diagnostics, so the client has a reader thread per server and a +status sink narrating server state onto the transient message row. B's +transport bones (socketpair, deadline-bounded writes, MSG_NOSIGNAL, +believe-the-server encoding) survive in it; its header is the design. -- **A · stdlib** — change `nvqpknzm` -- **B · client** — change `stuurqqt` +What a user must have installed, each on `PATH` (or named by its variable, +docs/typ/setup.typ): `zls` for `.zig` (one built for the Zig the project +uses), `rust-analyzer` for `.rs`, `clangd` for C and C++, `gopls` for Go, +`typescript-language-server` for TypeScript and JavaScript, +`pyright-langserver` for Python. A file whose server is missing is said so +once, and its language words answer `language server for .x not found`. -Both are one `jj new <change>` away if the multi-language argument below wins -later, or if the ZLS coupling ever needs backing out. - -> **Addendum, 2026-09-01.** The multi-language argument won. The tree now has -> a REAL protocol client beside the in-process analyser — -> `src/lsp/lsp_client.zig`, routed per file by the seam — but it is a new -> implementation, not `stuurqqt` resurrected: B pumped the socket only while -> a query waited, which cannot carry an indexing server's `$/progress` or -> unsolicited diagnostics, so the client has a reader thread per server and a -> status sink narrating server state onto the transient message row. B's -> transport bones (socketpair, deadline-bounded writes, MSG_NOSIGNAL, -> believe-the-server encoding) survive in it. See "The protocol client" in -> docs/typ/building.typ. +A (`nvqpknzm`), B (`stuurqqt`) and C's last state (the parent of +`kvlpprms`) remain whole commits. ## Recommendation (as written before the decision) diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 29675db9..a3ee88c3 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -126,6 +126,9 @@ Signatures use syntax colors; only calls to the queried function get background emphasis, and tree guides continue through multiline signatures and wrapped rows. Cross-directory call locations use shorter relative paths. +- Lspinfo's `+Lsp` starts with its language servers: the `backend: + lsp-client` line, left from when Zig files had an in-process backend of + their own, is gone. - A terminal follows the shell at its prompt (the tty's foreground group), not the process pardes started: a shell that re-execs itself under a wrapper (fish's `exec 9ns --mntgen -- fish`) no longer leaves the pane diff --git a/src/lsp/lsp.zig b/src/lsp/lsp.zig index 88d9cda2..2781077a 100644 --- a/src/lsp/lsp.zig +++ b/src/lsp/lsp.zig @@ -97,8 +97,6 @@ const has_client = switch (@import("pardes_config").platform) { }; const client = if (has_client) @import("lsp_client.zig") else void; -pub const backend_name = "lsp-client"; - pub const supports: std.EnumSet(Kind) = if (has_client) client.supports else .empty; pub fn speaks(path: []const u8) bool { @@ -107,7 +105,6 @@ pub fn speaks(path: []const u8) bool { pub fn query(io: std.Io, arena: std.mem.Allocator, req: Req, out: *std.Io.Writer) !void { if (req.kind == .status) { - try out.print("backend: {s}\n", .{backend_name}); if (has_client) try client.query(io, arena, req, out); return; } diff --git a/src/lsp/lsp_client.zig b/src/lsp/lsp_client.zig index 94d5bded..f2c186a8 100644 --- a/src/lsp/lsp_client.zig +++ b/src/lsp/lsp_client.zig @@ -2170,7 +2170,7 @@ fn notification(c: *Conn, io: std.Io, si: usize, g: u32, raw: []const u8, method // ------------------------------------------------------------- introspection fn status(io: std.Io, out: *std.Io.Writer) !void { - try out.print("\nprotocol servers (lsp-client):\n", .{}); + try out.print("language servers:\n", .{}); for (&specs, 0..) |*s, i| { const c = &conns[i]; c.mu.lockUncancelable(io); diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index a584cc8f..3b8dae1e 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -2889,7 +2889,7 @@ test "Lspinfo's answer is the +Lsp pane it fills, as a Rename preview's is its + defer p.deinit(); p.fs.lsp_result = null; p.lspRequest(p.active, .status, ""); - p.lspResponse(p.lsp_wait.?.id, "backend: lsp-client\n"); + p.lspResponse(p.lsp_wait.?.id, "language servers:\n"); const shown = p.paneBySerial(p.fs.lsp_result.?).?; try testing.expect(std.mem.endsWith(u8, p.panes[shown].?.file.?.path, "+Lsp")); } diff --git a/test/lspbench.zig b/test/lspbench.zig index 9857b61c..4b107b25 100644 --- a/test/lspbench.zig +++ b/test/lspbench.zig @@ -175,7 +175,6 @@ fn runOnce(gpa: std.mem.Allocator, req_in: lsp.Req, expected: []const u8, r: *Re fn reportText(rs: []const Result, rss: u64) void { const o = std.debug.print; - o("backend: {s}\n\n", .{lsp.backend_name}); o("{s:<24} {s:>9} {s:>7} {s:>10} {s:>10} {s}\n", .{ "kind", "supports", "rows", "cold(us)", "warm(us)", "verdict" }); o("{s}\n", .{&@as([78]u8, @splat('-'))}); var claimed: usize = 0; @@ -206,7 +205,7 @@ fn reportText(rs: []const Result, rss: u64) void { fn reportJson(rs: []const Result, rss: u64) void { const o = std.debug.print; - o("{{\"backend\":\"{s}\",\"rss_kib\":{d},\"probes\":[", .{ lsp.backend_name, rss }); + o("{{\"rss_kib\":{d},\"probes\":[", .{rss}); for (rs, 0..) |r, i| { if (i > 0) o(",", .{}); o("{{\"kind\":\"{s}\",\"supports\":{},\"rows\":{d},\"correct\":{},\"cold_us\":{d},\"warm_us\":{d}}}", .{ diff --git a/test/process/builtins.zig b/test/process/builtins.zig index 410a3f54..55f4ed49 100644 --- a/test/process/builtins.zig +++ b/test/process/builtins.zig @@ -7,7 +7,7 @@ const has = process.has; const check = process.check; pub const cases = .{ - .{ "builtins: Lspinfo opens one +Lsp pane saying the backend and its servers, detached and in a pty", lspinfo }, + .{ "builtins: Lspinfo opens one +Lsp pane saying its language servers, detached and in a pty", lspinfo }, }; fn lspinfo(gpa: std.mem.Allocator, exe: [:0]const u8) !void { @@ -43,7 +43,7 @@ fn lspinfo(gpa: std.mem.Allocator, exe: [:0]const u8) !void { process.nap(5); }; const body = try c.pane(a, lsp, "body"); - try check(std.mem.startsWith(u8, body, "backend: lsp-client\n") and has(body, "protocol servers (lsp-client):"), "{s}", .{body}); + try check(std.mem.startsWith(u8, body, "language servers:\n") and has(body, " zls "), "{s}", .{body}); try std.testing.expectEqualStrings("initial\n", try c.read(a, "/pane/1/body")); var f: process.Files = .init(gpa, address); defer f.deinit(); diff --git a/test/snapshots/lspdebug.snap b/test/snapshots/lspdebug.snap index 22fa097b..c66a5d67 100644 --- a/test/snapshots/lspdebug.snap +++ b/test/snapshots/lspdebug.snap @@ -30,8 +30,7 @@ snap why-closed # Check the report's answers, not installed compiler paths or dependency counts. key space l i -wait 10000 backend: lsp-client -wait 10000 protocol servers (lsp-client): +wait 10000 language servers: wait 10000 zls key space w j enter key / |
