summaryrefslogtreecommitdiff
path: root/test/snapshots/lsprelpath.snap
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-09 09:43:51 -0300
committerGabriel Schneider <[email protected]>2026-08-10 09:17:07 -0300
commit218d8577cbffb45a6ee80cea52418864a044e452 (patch)
treeb0b31c1e8091d6dea6fb767883e8c78e48cc385e /test/snapshots/lsprelpath.snap
parent599dd82f96b9d091aae78300aa6c3fbc81f9eb69 (diff)
downloadpardes-218d8577cbffb45a6ee80cea52418864a044e452.tar.gz
pardes-218d8577cbffb45a6ee80cea52418864a044e452.zip
lsp rows: paths relative to the asking file, and the completion text
Diffstat (limited to 'test/snapshots/lsprelpath.snap')
-rw-r--r--test/snapshots/lsprelpath.snap87
1 files changed, 87 insertions, 0 deletions
diff --git a/test/snapshots/lsprelpath.snap b/test/snapshots/lsprelpath.snap
new file mode 100644
index 00000000..dce26d1e
--- /dev/null
+++ b/test/snapshots/lsprelpath.snap
@@ -0,0 +1,87 @@
+# What a language row SPELLS its path as, and that both spellings still LOOK.
+#
+# A row is written relative to the directory of the file the query was asked
+# about (lsp.rel, fed from Req.root) when the answer lives UNDER that directory,
+# and keeps its full absolute path when it does not — a `gr` list was otherwise
+# the same forty-character prefix repeated down the pane with the part you came
+# to read pushed off the right edge, and a path outside the tree has nothing
+# short to be called.
+#
+# lspcomplete.snap already covers the easy middle case, a candidate in the SAME
+# directory, which shortens to a bare basename. The two that a prefix strip can
+# actually get wrong are here, one app each:
+#
+# PARENT the enum is one level UP from the asking file, so nothing is
+# stripped and the row carries `/tmp/.../cwd/shade.zig`. This is
+# the case that must NOT become `../shade.zig`.
+# SUBDIRECTORY the enum is one level DOWN, so the strip leaves a path with a
+# separator still in it — `inner/tint.zig`, not `tint.zig`. A
+# strip that took the basename instead would produce a row that
+# resolves to nothing.
+#
+# `n` is the assertion in both, not the row text: it looks row 1 and the right
+# file opens with the member SELECTED on its own line. The style capture is
+# where that selection shows, because focus goes back to the pane that asked,
+# so the opened pane's cursor is not in the snap header.
+dirmk sub
+dirmk sub/inner
+file shade.zig pub const Shade = enum {\n verdigris,\n cinnabar,\n};\n
+file sub/inner/tint.zig pub const Tint = enum {\n ochre,\n indigo,\n};\n
+file sub/parent.zig const shade = @import("../shade.zig");\n\npub fn pick(s: shade.Shade) u8 {\n return switch (s) {\n \n };\n}\n
+file sub/subdir.zig const tint = @import("inner/tint.zig");\n\npub fn hue(t: tint.Tint) u8 {\n return switch (t) {\n \n };\n}\n
+# ---- PARENT: outside the asking file's tree, so the row stays absolute ----
+start 34 100 sub/parent.zig
+wait 8000 fn pick
+stable 700 20000
+# file line 5 (grid row 6, 1-based click row 7) is the switch's empty body
+press left 8 7
+release left 8 7
+stable 400 5000
+key i
+key end
+text .
+stable 400 5000
+key tab
+wait 15000 cwd/shade.zig:2:
+stable 700 15000
+snap absrow
+key esc
+settle 100
+# An absolute row has to keep resolving — it is the spelling every row had
+# before this, and the one every hit outside the tree still has.
+key n
+stable 700 15000
+snap abslook
+snapstyle abslook
+# ---- SUBDIRECTORY: under it, so the strip leaves `inner/tint.zig` ----
+start 34 100 sub/subdir.zig
+wait 8000 fn hue
+stable 700 20000
+press left 8 7
+release left 8 7
+stable 400 5000
+key i
+key end
+text .
+stable 400 5000
+key tab
+wait 15000 inner/tint.zig:2:
+stable 700 15000
+snap subrow
+key esc
+settle 100
+key n
+stable 700 15000
+snap sublook
+snapstyle sublook
+# The mouse spelling, on the OTHER row (grid row 33, 1-based click row 34). A
+# right click expands to the file-ish word under the cursor
+# (config.wordBounds), which has to take `inner/tint.zig:3:5-10` WHOLE — the
+# separator inside a stripped path is a file char, so the scan runs back over
+# `inner/` and stops on the space of the line-number prefix. A look focuses
+# what it opens, so the header's cursor is the assertion: the end of `indigo`
+# on line 3 of tint.zig.
+press right 12 34
+release right 12 34
+stable 700 15000
+snap clicked