summaryrefslogtreecommitdiff
path: root/src/lsp
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-09 00:52:52 -0300
committerGabriel Schneider <[email protected]>2026-11-09 01:28:28 -0300
commit5157579ff7f9ae0cfc3c7629e953da05bce340fc (patch)
tree02147789efdcea998981efcfe05d4bcb3e9bb7b0 /src/lsp
parent4c4b9bf54d77dbc0f9f4e2619746908e501c6001 (diff)
downloadpardes-5157579ff7f9ae0cfc3c7629e953da05bce340fc.tar.gz
pardes-5157579ff7f9ae0cfc3c7629e953da05bce340fc.zip
tests: at the end of their files: every top-level test block of the 46 files that had one mid-file (the locality analysis's 45 and test/hxdiff.zig; gui.zig, macos.zig, look, host_io, 9p_io, terminal, tui, mouse, fs, replica, layout among them, 11,429 test lines), with the functions only tests call, moved after the file's code in their order, a mechanical move (.scratch/suites/tests_to_end.py), zig fmt'd; the unit suites pass as before (tui 1486/1487, gui 1536/1537, core 956/956 on both), macos.zig only parse-checked here
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/lsp')
-rw-r--r--src/lsp/lsp.zig22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lsp/lsp.zig b/src/lsp/lsp.zig
index eefa27c9..3f8fcde3 100644
--- a/src/lsp/lsp.zig
+++ b/src/lsp/lsp.zig
@@ -80,17 +80,6 @@ pub fn explaining(req: Req) Req {
return r;
}
-test "an explain request narrates the query named in its arg, a definition by default" {
- const base: Req = .{ .kind = .explain, .path = "/x.zig", .source = "", .offset = 0 };
- var r = base;
- r.arg = "hover ";
- try std.testing.expectEqual(Kind.hover, explaining(r).explains);
- r.arg = "rename newName";
- try std.testing.expectEqual(Kind.rename, explaining(r).explains);
- try std.testing.expectEqualStrings("newName", explaining(r).arg);
- try std.testing.expectEqual(Kind.definition, explaining(base).explains);
-}
-
/// Every language, Zig's (zls) included, through the protocol client, which
/// runs its server as a child process.
const client = @import("lsp_client.zig");
@@ -167,6 +156,17 @@ pub fn lineCol(source: []const u8, offset: usize) struct { line: usize, col: usi
return .{ .line = line, .col = upto.len - bol };
}
+test "an explain request narrates the query named in its arg, a definition by default" {
+ const base: Req = .{ .kind = .explain, .path = "/x.zig", .source = "", .offset = 0 };
+ var r = base;
+ r.arg = "hover ";
+ try std.testing.expectEqual(Kind.hover, explaining(r).explains);
+ r.arg = "rename newName";
+ try std.testing.expectEqual(Kind.rename, explaining(r).explains);
+ try std.testing.expectEqualStrings("newName", explaining(r).arg);
+ try std.testing.expectEqual(Kind.definition, explaining(base).explains);
+}
+
test "LSP encoders report every insufficient output capacity" {
const cases = [_]struct { kind: enum { row, span, source_span, edit, put }, expected: []const u8 }{
.{ .kind = .row, .expected = "file:1:3 hi\n" },