summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/snapshots/lsp.golden287
-rw-r--r--test/snapshots/lsp.snap53
2 files changed, 340 insertions, 0 deletions
diff --git a/test/snapshots/lsp.golden b/test/snapshots/lsp.golden
new file mode 100644
index 00000000..c85a412b
--- /dev/null
+++ b/test/snapshots/lsp.golden
@@ -0,0 +1,287 @@
+== snap opened grid=120x40 cursor=7,2
+|Kill Newcol Tutor Debug NextColor Dump Find Grep
+| NOR /tmp/pardes-snap/lsp/cwd/a.zig Save Del NOR /tmp/pardes-snap/lsp/cwd Del
+| 1 const std = @import("std");
+| 2 a.zig
+| 3 fn helper(x: u32) u32 {
+| 4 return x + 1;
+| 5 }
+| 6
+| 7 pub fn main() void {
+| 8 _ = helper(41);
+| 9 }
+| 10
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== snap cursor grid=120x40 cursor=17,9
+|Kill Newcol Tutor Debug NextColor Dump Find Grep
+| NOR /tmp/pardes-snap/lsp/cwd/a.zig Save Del NOR /tmp/pardes-snap/lsp/cwd Del
+| 1 const std = @import("std");
+| 2 a.zig
+| 3 fn helper(x: u32) u32 {
+| 4 return x + 1;
+| 5 }
+| 6
+| 7 pub fn main() void {
+| 8 _ = helper(41);
+| 9 }
+| 10
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== snap definition grid=120x40 cursor=10,4
+|Kill Newcol Tutor Debug NextColor Dump Find Grep
+| NOR /tmp/pardes-snap/lsp/cwd/a.zig Save Del NOR /tmp/pardes-snap/lsp/cwd Del
+| 1 const std = @import("std");
+| 2 a.zig
+| 3 fn helper(x: u32) u32 {
+| 4 return x + 1;
+| 5 }
+| 6
+| 7 pub fn main() void {
+| 8 _ = helper(41);
+| 9 }
+| 10
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== snap hover grid=120x40 cursor=10,4
+|Kill Newcol Tutor Debug NextColor Dump Find Grep
+| NOR /tmp/pardes-snap/lsp/cwd/a.zig Save Del NOR /tmp/pardes-snap/lsp/cwd Del
+| 1 const std = @import("std");
+| 2 a.zig
+| 3 fn helper(x: u32) u32 {
+| 4 return x + 1;
+| 5 }
+| 6
+| 7 pub fn main() void {
+| 8 _ = helper(41);
+| 9 }
+| 10
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/lsp/cwd/+Hover Del
+| 1 fn helper(x: u32) u32
+| 2 (fn (u32) u32)
+== snap symbols grid=120x40 cursor=10,4
+|Kill Newcol Tutor Debug NextColor Dump Find Grep
+| NOR /tmp/pardes-snap/lsp/cwd/a.zig Save Del NOR /tmp/pardes-snap/lsp/cwd Del
+| 1 const std = @import("std");
+| 2 a.zig
+| 3 fn helper(x: u32) u32 {
+| 4 return x + 1;
+| 5 }
+| 6
+| 7 pub fn main() void {
+| 8 _ = helper(41);
+| 9 }
+| 10
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/lsp/cwd/+Search Del
+| 1 /tmp/pardes-snap/lsp/cwd/a.zig:1:7 std
+| 2 /tmp/pardes-snap/lsp/cwd/a.zig:3:4 helper fn helper(
+| 3 /tmp/pardes-snap/lsp/cwd/a.zig:7:8 main fn main() vo
+| NOR /tmp/pardes-snap/lsp/cwd/+Hover Del
+| 1 fn helper(x: u32) u32
+| 2 (fn (u32) u32)
+== snap step grid=120x40 cursor=13,2
+|Kill Newcol Tutor Debug NextColor Dump Find Grep
+| NOR /tmp/pardes-snap/lsp/cwd/a.zig Save Del NOR /tmp/pardes-snap/lsp/cwd Del
+| 1 const std = @import("std");
+| 2 a.zig
+| 3 fn helper(x: u32) u32 {
+| 4 return x + 1;
+| 5 }
+| 6
+| 7 pub fn main() void {
+| 8 _ = helper(41);
+| 9 }
+| 10
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/lsp/cwd/+Search Del
+| 1 /tmp/pardes-snap/lsp/cwd/a.zig:1:7 std
+| 2 /tmp/pardes-snap/lsp/cwd/a.zig:3:4 helper fn helper(
+| 3 /tmp/pardes-snap/lsp/cwd/a.zig:7:8 main fn main() vo
+| NOR /tmp/pardes-snap/lsp/cwd/+Hover Del
+| 1 fn helper(x: u32) u32
+| 2 (fn (u32) u32)
+== snap nothing grid=120x40 cursor=7,4
+|Kill Newcol Tutor Debug NextColor Dump Find Grep
+| NOR /tmp/pardes-snap/lsp/cwd/a.zig Save Del NOR /tmp/pardes-snap/lsp/cwd Del
+| 1 const std = @import("std");
+| 2 a.zig
+| 3 fn helper(x: u32) u32 {
+| 4 return x + 1;
+| 5 }
+| 6
+| 7 pub fn main() void {
+| 8 _ = helper(41);
+| 9 }
+| 10
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/lsp/cwd/+Search Del
+| 1 /tmp/pardes-snap/lsp/cwd/a.zig:1:7 std
+| 2 /tmp/pardes-snap/lsp/cwd/a.zig:3:4 helper fn helper(
+| 3 /tmp/pardes-snap/lsp/cwd/a.zig:7:8 main fn main() vo
+| NOR /tmp/pardes-snap/lsp/cwd/+Hover Del
+| 1 fn helper(x: u32) u32
+| 2 (fn (u32) u32)
diff --git a/test/snapshots/lsp.snap b/test/snapshots/lsp.snap
new file mode 100644
index 00000000..9ea84e1f
--- /dev/null
+++ b/test/snapshots/lsp.snap
@@ -0,0 +1,53 @@
+# Language intelligence end to end: the helix keymap, the async round trip and
+# the two dispositions of an answer.
+#
+# The backend behind the seam here is ZLS linked in as a LIBRARY
+# (src/lsp_zls.zig) — no server process, no JSON-RPC — so `gd` is a function
+# call on a worker thread whose result comes back as an ordinary event, the
+# same shape a pty read already had. Nothing in this script knows that: it
+# presses keys and reads the grid, which is the point of the seam.
+#
+# a.zig is deliberately self-contained — a definition, a call site, and not one
+# symbol from std — so these goldens do not encode this machine's stdlib
+# version or its install path.
+file a.zig const std = @import("std");\n\nfn helper(x: u32) u32 {\n return x + 1;\n}\n\npub fn main() void {\n _ = helper(41);\n}\n
+start 40 120 a.zig
+wait 8000 helper
+stable 700 20000
+snap opened
+# park the cursor inside the CALL `helper(41)` (file line 8, grid row 9)
+press left 18 10
+release left 18 10
+stable 400 5000
+snap cursor
+# gd on a call: exactly one location comes back, so it JUMPS rather than
+# opening a picker — the cursor lands on the definition's name token, line 3.
+# The jumplist is pinned first, so ctrl-o comes back.
+key g
+key d
+stable 700 15000
+snap definition
+# SPC k is hover (K is keep_selections in helix and stays that way). The answer
+# is prose, not locations, so it opens +Hover and does NOT arm the n/N stepper.
+key space
+key k
+stable 700 15000
+snap hover
+# SPC s lists the file's own symbols. Several rows, so it opens a +Search
+# buffer — which IS the picker: n steps a row and looks it, exactly as the Find
+# and `/` results already do, with no picker code of its own.
+key space
+key s
+stable 700 15000
+snap symbols
+key n
+stable 700 15000
+snap step
+# gd on something with no declaration behind it (a keyword) answers nothing,
+# and nothing is a legal answer: no buffer opens, no error is rendered.
+press left 8 5
+release left 8 5
+key g
+key d
+stable 700 10000
+snap nothing