diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 06:24:55 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 07:16:43 -0300 |
| commit | 4195c285e860435b1251d010422831ec137d7e60 (patch) | |
| tree | fc4686352d0491f1ca160e6f78a1da22914b1604 | |
| parent | 85b60dedb6bdb192abd11b2d58ca7c0e8c944b18 (diff) | |
| download | pardes-4195c285e860435b1251d010422831ec137d7e60.tar.gz pardes-4195c285e860435b1251d010422831ec137d7e60.zip | |
Lspinfo before any query says a server is not started yet, its first query starting it, not `off` while it is on PATH
A server is spawned on its first query; until then its row said `off`,
which reads as disabled. It now says `not started yet (its first query
starts it)`; a server disabled by its environment still says so.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| -rw-r--r-- | src/lsp/lsp_client.zig | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lsp/lsp_client.zig b/src/lsp/lsp_client.zig index b57b348e..338dba61 100644 --- a/src/lsp/lsp_client.zig +++ b/src/lsp/lsp_client.zig @@ -1769,7 +1769,8 @@ fn status(req: lsp.Req, out: *std.Io.Writer) !void { const thier = c.caps.type_hier; c.unlock(); const env_v = if (getenv(s.env)) |v| std.mem.span(v) else null; - try out.print(" {s:<28} {s}", .{ s.name, @tagName(state) }); + // Never spawned is not off: the first query of its files starts it. + try out.print(" {s:<28} {s}", .{ s.name, if (state == .off) "not started yet (its first query starts it)" else @tagName(state) }); if (state == .ready or state == .starting) { try out.print(" root {s} {s}", .{ root, @tagName(enc) }); if (pull) try out.print(" pull-diags", .{}); @@ -2262,3 +2263,10 @@ test "a language with no server to start says so, not that it did not answer" { try query(std.testing.allocator, arena.allocator(), .{ .kind = .hover, .path = "/x/a.py", .source = "", .offset = 0 }, &out); try std.testing.expectEqualStrings("@none language server for .py not found\n", out.buffered()); } + +test "Lspinfo before any query says a server is not started yet, not off" { + var out: std.Io.Writer.Allocating = .init(std.testing.allocator); + defer out.deinit(); + try status(.{ .kind = .status, .path = "", .source = "", .offset = 0 }, &out.writer); + try std.testing.expect(std.mem.indexOf(u8, out.written(), "not started yet (its first query starts it)") != null); +} |
