diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 12:19:39 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 267f48d215366fdf3bb90d655e3af33f723a6f94 (patch) | |
| tree | 9782e7d288ecd4efa4d38c70d6f3e84f9953ebd4 /src/lsp/lsp_client.zig | |
| parent | 4f57043e39396bc958a103f87466870cf8dafe00 (diff) | |
| download | pardes-267f48d215366fdf3bb90d655e3af33f723a6f94.tar.gz pardes-267f48d215366fdf3bb90d655e3af33f723a6f94.zip | |
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 <[email protected]>
Diffstat (limited to 'src/lsp/lsp_client.zig')
| -rw-r--r-- | src/lsp/lsp_client.zig | 5 |
1 files changed, 3 insertions, 2 deletions
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) { |
