summaryrefslogtreecommitdiff
path: root/test/snapshots/lsp.snap
blob: 97fcf7ed3fc5187a5dcfa4445e8f0353f72b008d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# 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, run as a child process by the
# protocol client (it must be on PATH): `gd` is a request 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 41 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 11
release left 18 11
stable 400 5000
snap cursor
# gd on a call: exactly one location comes back, so it JUMPS rather than
# opening a picker — and lands SELECTING the definition's name token on line 3,
# because ZLS answers with a range and a ranged row is one a look selects.
# The jumplist is pinned first, so ctrl-o comes back.
key g
key d
stable 700 15000
snap definition
# SPC l 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 l
key k
stable 700 15000
snap hover
# SPC l s lists the file's own symbols. Several rows, so it opens a +Search
# buffer — which IS the picker: n selects a row and Enter looks it, exactly as
# the Find and `/` results already do, with no picker code of its own.
key space
key l
key s
stable 700 15000
snap symbols
key n
key enter
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 6
release left 8 6
key g
key d
stable 700 10000
snap nothing