From 63e6ceefc7ab33e31c9d4f83387183e44089e443 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:35:18 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/lsp/lsp.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lsp/lsp.zig') 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 "); } -- cgit v1.3