summaryrefslogtreecommitdiff
path: root/test/snapshots/lsp.snap
diff options
context:
space:
mode:
Diffstat (limited to 'test/snapshots/lsp.snap')
-rw-r--r--test/snapshots/lsp.snap53
1 files changed, 53 insertions, 0 deletions
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