summaryrefslogtreecommitdiff
path: root/test/lspbench.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-29 00:13:08 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commit841038666a45b40107ee26d1f8e54ed19d0891a0 (patch)
tree3cc4fb3b562d3fa8422f9ffe754e87c75a555862 /test/lspbench.zig
parentf43c1e11b44e2464f0bb0b635e0abcaf3c717e23 (diff)
downloadpardes-841038666a45b40107ee26d1f8e54ed19d0891a0.tar.gz
pardes-841038666a45b40107ee26d1f8e54ed19d0891a0.zip
lspbench: probe diagnostics and format against a BROKEN fixture
Plus docs/lsp-evaluation.md: the three backends measured head to head.
Diffstat (limited to 'test/lspbench.zig')
-rw-r--r--test/lspbench.zig13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/lspbench.zig b/test/lspbench.zig
index 73b82e2b..307bdc49 100644
--- a/test/lspbench.zig
+++ b/test/lspbench.zig
@@ -72,18 +72,23 @@ const anchors = [_]Anchor{
.{ .file = "src/modal.zig", .needle = "pub fn ", .at = 7, .kind = .document_symbols, .expect = "" },
// references to a symbol used in several places
.{ .file = "src/lsp.zig", .needle = "pub const Kind", .at = 11, .kind = .references, .expect = "" },
- // diagnostics on a file that should have none
- .{ .file = "src/lsp.zig", .needle = "const std", .at = 6, .kind = .diagnostics, .expect = "" },
+ // Diagnostics and format probe a DELIBERATELY BROKEN fixture, never the
+ // real source. On a clean corpus the correct answer is nothing, which is
+ // byte-identical to "this backend has no diagnostics" — a blind spot that
+ // rewards emitting a filler row and punishes honesty. test/lspfixture has
+ // an unused local (semantic: needs a compiler front end, not a tokenizer)
+ // and a misformatted fn (needs a formatter), so both probes have real work.
+ .{ .file = "test/lspfixture/broken.zig", .needle = "unused_local", .at = 0, .kind = .diagnostics, .expect = "broken.zig" },
// the remaining kinds, probed once each so the matrix is complete
.{ .file = "src/lsp.zig", .needle = "lineCol(source", .at = 0, .kind = .declaration, .expect = "" },
.{ .file = "src/lsp.zig", .needle = "out: *std.ArrayList(u8)", .at = 10, .kind = .type_definition, .expect = "" },
.{ .file = "src/lsp.zig", .needle = "pub const Kind", .at = 11, .kind = .implementation, .expect = "" },
.{ .file = "src/lsp.zig", .needle = "pub const Kind", .at = 11, .kind = .select_refs, .expect = "" },
- .{ .file = "src/lsp.zig", .needle = "pub fn query", .at = 7, .kind = .format, .expect = "" },
+ .{ .file = "test/lspfixture/broken.zig", .needle = "badly_spaced", .at = 0, .kind = .format, .expect = "" },
.{ .file = "src/lsp.zig", .needle = "pub fn query", .at = 7, .kind = .code_action, .expect = "" },
.{ .file = "src/lsp.zig", .needle = "pub fn query", .at = 7, .kind = .rename, .expect = "" },
.{ .file = "src/lsp.zig", .needle = "pub const Kind", .at = 11, .kind = .workspace_symbols, .expect = "" },
- .{ .file = "src/lsp.zig", .needle = "const std", .at = 6, .kind = .workspace_diagnostics, .expect = "" },
+ .{ .file = "test/lspfixture/broken.zig", .needle = "unused_local", .at = 0, .kind = .workspace_diagnostics, .expect = "broken.zig" },
};
const Result = struct {