summaryrefslogtreecommitdiff
path: root/src/lsp/lsp.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:35:18 -0300
committerGabriel Schneider <[email protected]>2026-11-04 23:39:25 -0300
commit63e6ceefc7ab33e31c9d4f83387183e44089e443 (patch)
tree62a63e4924643680849e4bca46030d536dfa26bb /src/lsp/lsp.zig
parent383256a741117596931c4e3817491041fde5229d (diff)
downloadpardes-63e6ceefc7ab33e31c9d4f83387183e44089e443.tar.gz
pardes-63e6ceefc7ab33e31c9d4f83387183e44089e443.zip
lsp_client: try in place of 25 catch return error.OutOfMemory into an Err that already holds it, and of app(), which did the same; offsetAt, which only its test called, goes (the test checks posOf against strictOffset); query's gpa and status's req, never read, go, host_io's call and lspbench's two dropping the argument; the notes of the gone ZLS backend go, and renameEdits gets back its doc from above identAt
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/lsp/lsp.zig')
-rw-r--r--src/lsp/lsp.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lsp/lsp.zig b/src/lsp/lsp.zig
index 1263b583..88d9cda2 100644
--- a/src/lsp/lsp.zig
+++ b/src/lsp/lsp.zig
@@ -105,14 +105,14 @@ pub fn speaks(path: []const u8) bool {
return has_client and client.speaks(path);
}
-pub fn query(io: std.Io, gpa: std.mem.Allocator, arena: std.mem.Allocator, req: Req, out: *std.Io.Writer) !void {
+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, gpa, arena, req, out);
+ if (has_client) try client.query(io, arena, req, out);
return;
}
if (has_client and (req.kind == .explain or (client.speaks(req.path) and client.supports.contains(req.kind))))
- return client.query(io, gpa, arena, req, out);
+ return client.query(io, arena, req, out);
// Nothing asked: said why, where an empty answer would read as nothing
// found.
if (speaks(req.path))
@@ -216,6 +216,6 @@ test "a question no backend answers for a file says why rather than find nothing
var buf: [256]u8 = undefined;
var out: std.Io.Writer = .fixed(&buf);
// A file no server speaks for is answered, not left empty.
- try query(std.testing.io, std.testing.allocator, arena.allocator(), .{ .kind = .incoming_calls, .path = "/x/notes.txt", .source = "", .offset = 0 }, &out);
+ try query(std.testing.io, arena.allocator(), .{ .kind = .incoming_calls, .path = "/x/notes.txt", .source = "", .offset = 0 }, &out);
try std.testing.expectStringStartsWith(out.buffered(), "@none ");
}