diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-25 10:27:05 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-25 11:58:11 -0300 |
| commit | bfdc8a9e61dd20c91b68f62187e724d1a98445a4 (patch) | |
| tree | a020fcbdc9ca8be68aa8983837accc2328f0e742 /test | |
| parent | 8bcaa657b39f24f0f2457f5c28e7095d5113ba73 (diff) | |
| download | pardes-bfdc8a9e61dd20c91b68f62187e724d1a98445a4.tar.gz pardes-bfdc8a9e61dd20c91b68f62187e724d1a98445a4.zip | |
query: a language server's list is answered, not typed: one place lands on it (Diagnostics too now), the place fed as the text's places so it is tinted and n/N have it, no query pane; several open the list with the keyboard on its current row in normal mode (showCurrent: the caret on the rows is the current row, n/N take it there), its target shown, Esc in it back to the text as it was; none is a message; line 1 keeps its word as text; Diagnostics keep the keyboard in the text for ]d; lsp-client and lsprelpath step with n, their goldens the caret on the row and no insert marker
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016u3hBPFfja5pK4EBRC1UVD
Diffstat (limited to 'test')
| -rw-r--r-- | test/output.zig | 6 | ||||
| -rw-r--r-- | test/snapshots/lsp-client.golden | 4 | ||||
| -rw-r--r-- | test/snapshots/lsp-client.snap | 10 | ||||
| -rw-r--r-- | test/snapshots/lsprelpath.golden | 8 | ||||
| -rw-r--r-- | test/snapshots/lsprelpath.snap | 7 |
5 files changed, 20 insertions, 15 deletions
diff --git a/test/output.zig b/test/output.zig index 8eb389c8..530db77c 100644 --- a/test/output.zig +++ b/test/output.zig @@ -219,9 +219,11 @@ test "references fill the asking text's query pane: sorted under their files, th try std.testing.expectEqual(@as(?usize, 2), source.places.current); try std.testing.expectEqual(@as(i32, 3), source.body.cur_row); try std.testing.expectEqual(@as(usize, 6), results.query.?.total); - // Ctrl-n on line 1, Enter: the keyboard on that ref in the text + // A list answered, not a query typed: the keyboard on its current row in + // normal mode; n, Enter: the keyboard on that ref in the text try std.testing.expectEqual(qid, p.active); - p.update(.{ .key = .{ .cp = 'n', .ctrl = true } }); + try std.testing.expect(results.body.mode == .normal and results.body.cur_row > 0); + p.update(.{ .key = .{ .cp = 'n' } }); try std.testing.expectEqual(@as(?usize, 3), source.places.current); p.update(.{ .key = .{ .cp = Key.enter } }); try std.testing.expectEqual(@as(usize, 0), p.active); diff --git a/test/snapshots/lsp-client.golden b/test/snapshots/lsp-client.golden index 18ccd775..f3d7006e 100644 --- a/test/snapshots/lsp-client.golden +++ b/test/snapshots/lsp-client.golden @@ -15,9 +15,9 @@ | 3 a + b | 4 } | 5 -== snap gr-list grid=100x25 cursor=7,14 +== snap gr-list grid=100x25 cursor=2,16 |3: 1 mod lib; -|13: ^ +Search 1/3 Del +|13: +Search 1/3 Del |14: Refs |15: lib.rs |16: 2 pub fn add(a: i32, b: i32) -> i32 { diff --git a/test/snapshots/lsp-client.snap b/test/snapshots/lsp-client.snap index d9827a2a..159bf80e 100644 --- a/test/snapshots/lsp-client.snap +++ b/test/snapshots/lsp-client.snap @@ -7,7 +7,8 @@ # and the message row still carries the server's settled state # ("lsp lspmock: ready") because nothing has cleared it yet. # gr -> the text's query pane, line 1 `Refs`, rows under their files, -# the next occurrence current; n/N step the places in the text. +# the next occurrence current, the keyboard on it in normal mode +# (a list answered, not a query typed); n/N step the places. file main.rs mod lib;\n\nfn main() {\n let x = add(1, 2);\n let y = add(3, 4);\n let _ = x + y;\n}\n file lib.rs // mock fixture\npub fn add(a: i32, b: i32) -> i32 {\n a + b\n}\n start 25 100 main.rs @@ -27,9 +28,10 @@ key r wait 10000 add(3, 4) stable 700 15000 snap gr-list -# Ctrl-n on line 1 steps to the next hit, Enter lands there; N in the text -# goes back to the one before, round the places in main.rs -key c-n +# the list opens in normal mode, the caret on the current row: n steps to +# the next hit, Enter lands there; N in the text goes back to the one +# before, round the places in main.rs +key n key enter stable 700 15000 snap gr-opened diff --git a/test/snapshots/lsprelpath.golden b/test/snapshots/lsprelpath.golden index 59a3c5d0..6351de03 100644 --- a/test/snapshots/lsprelpath.golden +++ b/test/snapshots/lsprelpath.golden @@ -1,4 +1,4 @@ -== snap absrow grid=100x35 cursor=7,17 +== snap absrow grid=100x35 cursor=2,21 | Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit | New Tty Find Grep Joincol Delcol | /tmp/pardes-snap/lsprelpath/cwd/sub/parent.zig Save Tty Collapse TreeContext Def Refs Del @@ -15,7 +15,7 @@ | | | -|^ +Search 2/2 Del +| +Search 2/2 Del | Refs | /tmp/pardes-snap/lsprelpath/cwd/shade.zig | 1 pub const Shade = enum { @@ -72,7 +72,7 @@ |32: 0-0 d,#608269, 1-99 d,#0d1410, |33: 0-0 d,#608269, 1-99 d,#0d1410, |34: 0-0 d,#608269, 1-99 d,#0d1410, -== snap subrow grid=100x35 cursor=7,17 +== snap subrow grid=100x35 cursor=2,21 | Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit | New Tty Find Grep Joincol Delcol | /tmp/pardes-snap/lsprelpath/cwd/sub/subdir.zig Save Tty Collapse TreeContext Def Refs Del @@ -89,7 +89,7 @@ | | | -|^ +Search 2/2 Del +| +Search 2/2 Del | Refs | inner/tint.zig | 1 pub const Tint = enum { diff --git a/test/snapshots/lsprelpath.snap b/test/snapshots/lsprelpath.snap index 8420e134..70ca3fdc 100644 --- a/test/snapshots/lsprelpath.snap +++ b/test/snapshots/lsprelpath.snap @@ -44,8 +44,9 @@ wait 15000 cwd/shade.zig stable 700 15000 snap absrow # the current row is parent.zig's own; the one before it is shade.zig's, -# shown in the +Preview, which Enter makes shade.zig's pane -key c-p +# shown in the +Preview (N, the list in normal mode), which Enter makes +# shade.zig's pane +key N wait 10000 verdigris stable 700 15000 key enter @@ -63,7 +64,7 @@ key r wait 15000 inner/tint.zig stable 700 15000 snap subrow -key c-p +key N wait 10000 ochre stable 700 15000 key enter |
