summaryrefslogtreecommitdiff
path: root/test/snapshots/lspcompletemoved.snap
blob: 8351b31035764a433973b76e6986dc5445322b58 (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
# The guard that makes "an empty answer indents" safe to have at all.
#
# lspcomplete.snap pins the indent itself: Tab after a dot the backend cannot
# answer diverts, the answer comes back empty, and four spaces go in LATE so
# the keystroke is not eaten. That late write is the dangerous half — it lands
# a few hundred milliseconds after the key, by which time the hands have moved
# on — so lspResponse only performs it if nothing has: same pane, still insert,
# one cursor, cursor still on the cell the Tab was pressed at. Nothing covered
# the condition, only its happy side.
#
# Same file and same click as lspcomplete's `commentindent` arm — line 12 is a
# comment, so no candidate can exist and the answer is certainly empty — but
# here an `x` is typed straight after the Tab, in the same write, long before a
# ZLS analysis can finish. The buffer below is the assertion: `// note.x`, with
# neither `// note.    x` (the indent landing under the typing) nor
# `// note.x    ` (the indent landing on top of it).
file a.zig const Shade = enum {\n    verdigris,\n    cinnabar,\n};\n\nfn pick(s: Shade) u8 {\n    return switch (s) {\n        \n    };\n}\n\n// note. see below\n
start 21 120 a.zig
wait 8000 verdigris
stable 700 20000
press left 16 15
release left 16 15
stable 400 5000
key i
key tab
text x
stable 700 20000
snap typedthrough
key esc
settle 100
key space f s
stable 700 15000
snapfile buffer /tmp/pardes-snap/lspcompletemoved/cwd/a.zig