From 38e9919a9ea9055538409b388d580c4e4c838434 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 10 Aug 2026 09:14:05 -0300 Subject: fixed lsp rename --- test/snapshots/lsp-rename.golden | 75 ++++++++++++++++++++++++++++++++++++++++ test/snapshots/lsp-rename.snap | 27 +++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 test/snapshots/lsp-rename.golden create mode 100644 test/snapshots/lsp-rename.snap (limited to 'test') diff --git a/test/snapshots/lsp-rename.golden b/test/snapshots/lsp-rename.golden new file mode 100644 index 00000000..c15092b7 --- /dev/null +++ b/test/snapshots/lsp-rename.golden @@ -0,0 +1,75 @@ +== snap renamed grid=110x24 cursor=17,9 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +| /tmp/pardes-snap/lsp-rename/cwd/rename.zig Save New Del +| 1 const std = @import("std"); +| 2 +| 3 fn renamed_helper(x: u32) u32 { +| 4 return x + 1; +| 5 } +| 6 +| 7 pub fn main() void { +| 8 _ = renamed_helper(41); +| 9 } +| 10 +| 11 fn shadowed() void { +| 12 const helper: u32 = 7; +| 13 _ = helper; +| 14 } +| 15 +| +| +| +| +| +| +| +== snap undone grid=110x24 cursor=17,9 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +| /tmp/pardes-snap/lsp-rename/cwd/rename.zig Save New Del +| 1 const std = @import("std"); +| 2 +| 3 fn helper(x: u32) u32 { +| 4 return x + 1; +| 5 } +| 6 +| 7 pub fn main() void { +| 8 _ = helper(41); +| 9 } +| 10 +| 11 fn shadowed() void { +| 12 const helper: u32 = 7; +| 13 _ = helper; +| 14 } +| 15 +| +| +| +| +| +| +| +== snap redone grid=110x24 cursor=17,9 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +| /tmp/pardes-snap/lsp-rename/cwd/rename.zig Save New Del +| 1 const std = @import("std"); +| 2 +| 3 fn renamed_helper(x: u32) u32 { +| 4 return x + 1; +| 5 } +| 6 +| 7 pub fn main() void { +| 8 _ = renamed_helper(41); +| 9 } +| 10 +| 11 fn shadowed() void { +| 12 const helper: u32 = 7; +| 13 _ = helper; +| 14 } +| 15 +| +| +| +| +| +| +| diff --git a/test/snapshots/lsp-rename.snap b/test/snapshots/lsp-rename.snap new file mode 100644 index 00000000..c29b001e --- /dev/null +++ b/test/snapshots/lsp-rename.snap @@ -0,0 +1,27 @@ +# Rename end to end: the leader prompt, async ZLS resolution, atomic file edit, +# shadow filtering, and one-step undo/redo. The source has a same-spelled local +# which must not be changed when the top-level helper is renamed. +file rename.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\nfn shadowed() void {\n const helper: u32 = 7;\n _ = helper;\n}\n +start 24 110 rename.zig +wait 8000 helper(41) +stable 700 20000 +# Put the cursor inside the top-level call, then use the helix rename binding. +press left 18 10 +release left 18 10 +key space +key l +key r +stable 400 5000 +text renamed_helper +key enter +wait 10000 renamed_helper(41) +stable 700 15000 +snap renamed +# Both resolved top-level occurrences changed; the shadowed local stayed helper. +# The whole asynchronous rename is one history transaction. +key u +stable 400 5000 +snap undone +key U +stable 400 5000 +snap redone -- cgit v1.3