diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-26 02:49:36 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-26 04:10:54 -0300 |
| commit | 8393c24f76675f182055149645c10af3102b739e (patch) | |
| tree | 3844cb4b77d4225d604e7ad18dbf6dfd64dc72de /core/Pick.zig | |
| parent | 148e48dd9b8cd7e66aa1521daa49a64852b1650e (diff) | |
| download | pardes-8393c24f76675f182055149645c10af3102b739e.tar.gz pardes-8393c24f76675f182055149645c10af3102b739e.zip | |
lsp_client, Output, lspmock, syntax, Pick, Query, docs: the Symbols builtin (a language server's documentSymbol) gives the Symbols picker's marks and order (UX DESIGN N, binding: "The builtin `Symbols` keeps reading the server but gets the same mark, order and qualified names, from `SymbolKind`"): walkSymbols keeps each symbol's SymbolKind, mapped onto N2's kinds (5 Class, 10 Enum, 11 Interface, 23 Struct, 26 TypeParameter a type; 6 Method, 9 Constructor, 12 Function, 25 Operator a function; 7 Property, 8 Field, 22 EnumMember a field; 14 Constant a const; 13 Variable, 15 to 21 and 24 a var; 1 File to 4 Package a module; any other the other), and names each in the ones it is in (a DocumentSymbol's nesting, a SymbolInformation's `containerName`): a row is `shapes.rs:5:5-8 m Shape.side`, the rows types, functions, fields, then the rest, each in the server's order; the +Search keeps that order: a file's symbols are neither sorted by their places (Output.sortResults) nor laid out as Locations, which put a file's rows in their lines' order (Output.usesLocationsConfig): a row each, as the picker lists them; the walk's list picker (`Jumps walk`, Ask's) takes them in that order (tty `lsp` with zls: `f helper`, `f main`, `c std`, was `std`, `helper`, `main`); an index's Symbols (SCIP, dev/lsp/Scip.zig) keep their rows unmarked, one row each now too; the mock answers documentSymbol with a nested list in no kind's order (a const, a function, a struct with a field and a method, an enum with a member, a module); docs/typ guide's `Symbols name` and the reference's Symbols say the marks and the order; and three faults of the change before's rows, which its pictures showed (each TEST FIRST: the syntax.zig and Pick.zig tests failed with them first; the pattern guard came with its JavaScript case, not before it): a test whose name is longer than 200 bytes was no symbol, so its body was no scope and its local structs and functions were listed as types and functions (Pick.zig's own tests: `t typeIn = struct`): a name that long is cut, on a character, and a test's body lists nothing (370 rows of core/Pick.zig to 247); a name field is taken whole when it is one line (C++'s `namespace v8::internal::torque` named `v8`, now whole; a value binding's must still be a name, never a pattern: `const { x, y } = a`, OCaml's `let () =`); the qualifier dimmed in a row ran to the name's last `.`, a test's sentence's (`(SPEC §6.3, §7.3)` dimmed most of it): it is the candidate's `base` now, the qualifier's length from the gather, which also gives the scorer its basename bonus on the name; core/root.zig's import of syntax.zig (the change before) says what it does: without it a -Dtest-filter run compiles none of syntax.zig's tests, while a whole run has them (core-test 1135/1308 with it or without it; the change before said they ran nowhere: wrong); RUN (TEST FIRST): test/behaviour/language_servers.zig "language-servers: a server's Symbols are the Symbols picker's rows ..." opens shapes.rs with no index (the server asked) and asks the +Search's rows in that order: with walkSymbols' marks alone they came in their lines' order (`c LIMIT`, `f main`, `t Shape`, ...: the sort and the Locations layout), passes now; the index's Symbols test asks one row each (`lib.rs:1:11-15 Shape`); test/snapshots/lsp.golden re-recorded: only its symbols snap's three rows (marked and grouped) and the preview landing on their first, `helper`'s line 3; GATES on this stack (the change before under it): core-test 1135/1308 (173 skipped; base 1127/1301 with the base's one failure, a CPU-time test under load: colors' "the whole ring resolves in 150 ms"), shell-test 1356/1359 (3 skipped), pane-test 183/184 (1 skipped), behaviour-test 281/281 and --replay 281/281, process-test 1 of 147 failed (tty editing: lsp, its golden: re-recorded, the ten `tty editing: lsp` cases 0 of 10 failed), term-test 17/17, kitty-test 45/45; the dump fuzz (Names.Cand.group, Stream.Batch.symbols) at 40,000 join seeds twice and 1,779 image seeds 13/13; the soak `replicas -- --clients 5 --rtt 30,80,207`: diverged 0, unequal 0, quiet checks 421/0 415/0 590/0, unlisted stops 0, the corpus 22 of 22 scenes the same, no leak; the gui unit-test 1960/1964 (4 skipped; its one failure the perf check's BaselineHarnessMismatch, every base's); core-test, shell-test, pane-test and behaviour-test again after the three faults: the same counts; the pictures (the S kit at 26 px, neonotte84, 100x30, typed through the pty; .scratch/walkui/W6/png): today's install (install74) beside this tree's Debug gui, SPC s s on core/Pick.zig (today 127 rows of declarations, `pub fn deinit(...` first; here 247, `t Pick = @This()` first, the types, then the functions ...) and on V8's torque-parser.cc (today 132, here 273 under `v8::internal::torque.`), and `count` typed (today the cursor on `count`, then `paneCount` and every row whose signature holds c-o-u-n-t, `[]const u8` among them; here `f count` current, `f paneCount`, `c counts_zig`, then the tests whose sentences match); no frame or perf gate (the user's rule of 2026-11-26); load 3.0 to 14.2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/Pick.zig')
| -rw-r--r-- | core/Pick.zig | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/Pick.zig b/core/Pick.zig index 2b5714cb..dcb838f3 100644 --- a/core/Pick.zig +++ b/core/Pick.zig @@ -677,10 +677,9 @@ fn rowAt(p: *Pardes, pk: *const Pick, arena: std.mem.Allocator, i: usize) std.me for (marks_in, row.marks) |*m, at| m.* = at -| line; row.marks = marks_in; const name_at = cand.key - line; - const dot = std.mem.lastIndexOfScalar(u8, row.text[name_at .. name_at + cand.key_len], '.'); row.kind = @intCast(name_at - 1); row.pre = @intCast(name_at); - row.faint = @intCast(if (dot) |at| at + 1 else 0); + row.faint = cand.base; if (name_at + cand.key_len < row.text.len) row.quiet = .{ @intCast(name_at + cand.key_len), @intCast(row.text.len) }; const owner = p.panes[p.paneBySerial(pk.owner) orelse return row] orelse return row; const f = owner.file orelse return row; @@ -3357,7 +3356,7 @@ const counts_zig = \\pub fn count(text: []const u8) Counts { \\ return .{ .lines = text.len }; \\} - \\test "count" {} + \\test "count.add" {} \\ ; @@ -3381,9 +3380,12 @@ test "Symbols (UX DESIGN N): a Zig file's rows types, functions, fields, then th \\ 1 n std = @import("std") \\ 5 c Counts.zero : Counts = .{} \\12 v hits : u32 = 0 - \\16 · "count" + \\16 · "count.add" \\ , try rowLines(p, a)); + // The qualifier dim, `Counts.`; a name holding a `.` none of it. + try std.testing.expectEqual(@as(u16, "Counts.".len), (try rowAt(p, live(p).?, a, 4)).faint); + try std.testing.expectEqual(@as(u16, 0), (try rowAt(p, live(p).?, a, 11)).faint); // Drawn: `m Counts.lines : usize = 0` (not the cursor's row). const pane = p.panes[p.paneBySerial(live(p).?.landing).?].?; _ = try p.render(a); |
