summaryrefslogtreecommitdiff
path: root/src/lsp/lsp_client.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/lsp/lsp_client.zig')
-rw-r--r--src/lsp/lsp_client.zig10
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);
+}