From 267f48d215366fdf3bb90d655e3af33f723a6f94 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 12:19:39 -0300 Subject: Callers and Callees on a .zig file say the language server does not answer them The in-process ZLS answers no call hierarchy, and no other backend speaks .zig, so the question went nowhere and came back empty, as if nothing called the function. A question no backend answers, or a server that advertises no call or type hierarchy, now answers @none with why, which the core says. Co-Authored-By: Claude Opus 5.5 --- src/lsp/lsp_client.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lsp/lsp_client.zig') diff --git a/src/lsp/lsp_client.zig b/src/lsp/lsp_client.zig index c3762f08..55df1f91 100644 --- a/src/lsp/lsp_client.zig +++ b/src/lsp/lsp_client.zig @@ -408,6 +408,7 @@ pub fn query(gpa: std.mem.Allocator, arena: std.mem.Allocator, req: lsp.Req, out tr.note("STOP: no language server spec matches {s}", .{ if (req.path.len == 0) "a pane with no file" else req.path, }); + if (req.kind != .explain) return lsp.none(out, "no language server for {s}", .{if (req.path.len == 0) "a pane with no file" else std.fs.path.basename(req.path)}); return traceOut(&tr, req, out, 0, 0); }; tr.note("file {s} -> {s} (languageId {s})", .{ std.fs.path.basename(req.path), specs[si].name, specs[si].lang }); @@ -807,11 +808,11 @@ fn hierarchy(c: *Conn, si: usize, arena: std.mem.Allocator, cx: *Cx, uri: []cons const call_side = h == .incoming or h == .outgoing; if (call_side and !c.caps.call_hier) { tr.note("STOP: {s} does not advertise callHierarchyProvider", .{specs[si].name}); - return; + return lsp.none(cx.out, "{s} does not answer call hierarchy (no callHierarchyProvider)", .{specs[si].name}); } if (!call_side and !c.caps.type_hier) { tr.note("STOP: {s} does not advertise typeHierarchyProvider", .{specs[si].name}); - return; + return lsp.none(cx.out, "{s} does not answer type hierarchy (no typeHierarchyProvider)", .{specs[si].name}); } const prepare: []const u8 = if (call_side) "textDocument/prepareCallHierarchy" else "textDocument/prepareTypeHierarchy"; const follow: []const u8 = switch (h) { -- cgit v1.3