summaryrefslogtreecommitdiff
path: root/test/snapshots/lspdebug.snap
diff options
context:
space:
mode:
Diffstat (limited to 'test/snapshots/lspdebug.snap')
-rw-r--r--test/snapshots/lspdebug.snap52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/snapshots/lspdebug.snap b/test/snapshots/lspdebug.snap
new file mode 100644
index 00000000..a2160408
--- /dev/null
+++ b/test/snapshots/lspdebug.snap
@@ -0,0 +1,52 @@
+# The mouse chord and the two introspection builtins.
+#
+# Ctrl-left-click IS `gd`. It rides the ordinary left-click drag rather than
+# firing on the press, because a click does not place the modal cursor until
+# RELEASE — asking at press time would answer about wherever the cursor
+# happened to be sitting, which is the bug this test would not have caught.
+#
+# `SPC l w` and `SPC l i` exist because this backend never fails loudly: a
+# thrown analyser must not take the editor with it, but that makes a broken
+# backend and a correct one that found nothing look identical. These two tell
+# them apart, so they are worth a test that proves they say something TRUE.
+file z.zig const std = @import("std");\n\nfn helper() u32 {\n return 3;\n}\n\npub fn main() void {\n const v = helper();\n _ = v;\n}\n
+start 44 120 z.zig
+wait 8000 fn helper
+stable 700 20000
+snap opened
+# Ctrl-click on the `helper` of the CALL (row 10 = file line 8, col 22 = the
+# `h`). One definition, so it jumps rather than listing: the cursor lands on
+# line 3, the `helper` of `fn helper()`, in this same pane.
+press ctrl-left 22 10
+release ctrl-left 22 10
+stable 700 15000
+snap ctrlclick
+# A PLAIN left click in the same place must NOT jump — the modifier is the
+# whole difference, and without this the test above would pass on a bug that
+# made every click a goto.
+press left 22 10
+release left 22 10
+stable 700 15000
+snap plainclick
+# `SPC l w` on a keyword: `gd` finds nothing there, and the point of Lspwhy is
+# that it says WHY rather than leaving you with a no-op key. It narrates the
+# real resolution path — the position context is the analyser's own answer,
+# not a guess reconstructed beside it.
+text 3gg1g|
+stable 400 10000
+key space
+key l
+key w
+wait 10000 position context
+stable 700 15000
+snap why
+# `SPC l i`: which ZLS, which stdlib, what it answers, and the query log —
+# which by now holds the two gotos and the explain above, with their timings.
+# It answers from any pane, including one with no file, because it is about
+# the BACKEND.
+key space
+key l
+key i
+wait 10000 zls-inproc
+stable 700 15000
+snap info