summaryrefslogtreecommitdiff
path: root/test/lspbench.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/lspbench.zig')
-rw-r--r--test/lspbench.zig26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/lspbench.zig b/test/lspbench.zig
index ffea0e20..b294e60c 100644
--- a/test/lspbench.zig
+++ b/test/lspbench.zig
@@ -91,6 +91,32 @@ const anchors = [_]Anchor{
.{ .file = "src/lsp/lsp.zig", .needle = "pub fn query", .at = 7, .kind = .rename, .expect = "" },
.{ .file = "src/lsp/lsp.zig", .needle = "pub const Kind", .at = 11, .kind = .workspace_symbols, .expect = "" },
.{ .file = "test/lspfixture/broken.zig", .needle = "unused_local", .at = 0, .kind = .workspace_diagnostics, .expect = "broken.zig" },
+ // The three shapes a `.` can have, each with the cursor IMMEDIATELY AFTER
+ // the dot, which is where Tab asks from.
+ // a field access into std: `std.` lists what `std` declares, the same
+ // "can this backend reach the stdlib at all" test `gd` gets.
+ .{ .file = "src/lsp/lsp.zig", .needle = "std.mem.count(u8", .at = 4, .kind = .completion, .expect = "std.zig" },
+ // an enum literal in a FINISHED switch arm. The tree parses, so this
+ // probes the expected-type resolution and nothing else.
+ .{ .file = "src/lsp/lsp_zls.zig", .needle = ".declaration => try rowForToken", .at = 1, .kind = .completion, .expect = "type_definition" },
+ // the same thing on the BIGGEST file in the tree. This one is here for
+ // its latency column rather than its rows: a completion parses the
+ // buffer once per placeholder spelling it tries, so pardes.zig is where
+ // that shows up and where the figure quoted in docs/lsp.md comes from.
+ .{ .file = "src/pardes.zig", .needle = ".definition => .definition,", .at = 1, .kind = .completion, .expect = "" },
+ // an enum literal in a HALF-TYPED switch arm, which is what a real
+ // keypress looks like: the file does not parse and the switch is not in
+ // the tree at all. `verdigris` appears only on the enum member's own
+ // line, so a row carrying it came from the DEFINITION and not from the
+ // line the cursor sits on.
+ .{ .file = "test/lspfixture/dotcomplete.zig", .needle = "return switch (s) {\n .", .at = 29, .kind = .completion, .expect = "verdigris" },
+ // ...and the same dot on a line that is ALSO missing its terminator,
+ // which is one parse error repaired or not. This is the probe that
+ // catches a repair chosen by error count rather than by whether the dot
+ // became reachable in the tree.
+ // (the needle carries its indent: dothalf.zig's own header explains the
+ // shape and would otherwise be the first match)
+ .{ .file = "test/lspfixture/dothalf.zig", .needle = " const z: Shade = .", .at = 22, .kind = .completion, .expect = "verdigris" },
};
const Result = struct {