diff options
Diffstat (limited to 'core/lsp')
| -rw-r--r-- | core/lsp/Ask.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/lsp/Ask.zig b/core/lsp/Ask.zig index 0f4f39dc..c60eb72b 100644 --- a/core/lsp/Ask.zig +++ b/core/lsp/Ask.zig @@ -558,17 +558,21 @@ test "Lspwhy after a Hover asks to explain that hover, in its file at its place, try std.testing.expect(seen); } -test "Def and Refs are a speaking file's tag words; gd, gr and a 2-1 chord all run them" { +test "Def and Refs are a speaking file's words, out of its tag (UX K'4); gd, gr and a 2-1 chord on them typed in its tag all run them" { if (!lsp.supports.contains(.definition)) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 100, .rows = 24, .tty_only = true }); defer p.deinit(); const pane = try p.setTestFile("const alpha = 1;\nconst beta = alpha;\n"); // A .txt has no server: no Def, no Refs. - try std.testing.expect(std.mem.indexOf(u8, tagline.curTail(pane), "Def") == null); + try std.testing.expect(std.mem.indexOf(u8, tagline.kindTail(pane), "Def") == null); const f = &pane.file.?; p.gpa.free(f.path); f.path = try p.gpa.dupe(u8, "/tmp/x.zig"); - try std.testing.expect(std.mem.endsWith(u8, tagline.curTail(pane), " Def Refs Del")); + try std.testing.expect(std.mem.endsWith(u8, tagline.kindTail(pane), " Def Refs Del")); + // Its tag's computed words have neither: typed into its own text, they + // run as any word there does. + try std.testing.expect(std.mem.indexOf(u8, tagline.computedWords(pane), "Def") == null); + pane.tag.own = try p.gpa.dupe(u8, "Def Refs"); p.sync(); while (p.nextEffect()) |_| {} const Asked = struct { |
