From 5b065b537f15120184a6938d963d7302d0e4cc8d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 25 Nov 2026 01:45:39 -0300 Subject: lsp/Ask: a hover is drawn as ghost lines only when it was asked from the keyboard where jumps walk, decided when it is asked: a 9P script's Hover gets its +Hover pane again (walk UI M3 item 4, found by the merged tree's behaviour-test, line F's hover under the jumps default walk): RUN: behaviour-test "language-servers: Hover says the signature and the documentation the index has" (a Hover written to /pane/N/ctl) failed at language_servers.zig:195, no +Hover pane to read; THE CAUSE: core/lsp/Ask.zig chose the ghost lines when the ANSWER came (`w.kind == .hover and Pick.asked(p)`), and Pick.asked says "not a script's" by `p.fs.serving`, which is false by then (the answer arrives after the 9P write was answered), so every hover under walk became ghost lines, a script's too; line F's tree had jumps new-pane by default and never met it; THE FIX: the wait remembers it when asked (`ghost`, Pick.asked at the ask, in the dump and the digest with the wait), the answer reads it; a user could hit it: a script or a tool asking Hover over 9P in a session whose jumps walk read no +Hover; TEST: the behaviour test above (fails before, passes now), lsp/Ask.zig's "a hover asked from the keyboard is ghost lines ..." still passes ; THE MERGED TREE'S GATES (walk UI M3 item 4, on this change; load 2-6 on 16 CPUs): tui core-test 1055/1225 (170 skipped, 0 failed), shell-test 1272/1275, pane-test 183/184, behaviour-test 277/277 and with --replay 277/277, process-test 0 of 146 failed (2 skipped), term-test 17/17, kitty-test 45/45; the 40,000-seed dump fuzz with a kept picker, a recipe and a search word in its session (G2/fuzz40k.sh): FAILS at join seed 4135 (and without the new session lines at join seed 33733, G2/fuzzbare.sh): `panic: index out of bounds: index 43690, len 96` in the digest after a load (walk.zig:568 hash, tape.digestOf from fuzz.zig loadSeed): a loaded live message's `Messages.Said.src` (a Kind.Buf(96)) has a length never written (0xAAAA, the safe allocator's fill), not fixed here; the named seeds 19224 and 31554 (H's opens_len fix) pass; the 5-client soak (G2/soak.sh): no double free (H's xkpmuwtz holds), corpus through a client 22 scenes the same, unequal 0, diverged 1: seed 2 rtt 207 ms client 3 "the core called pty_resize where the tape has a done (0) (tape byte 149, in step)", not fixed here; frame gate walkui-G2 against tree7: 77 frames, 77 differ, each byte-identical to line C's gate's (walkui-C: the notice row): the corpus runs under `Jumps new-pane`, so no Keep or reading tint in it and the walk UI adds nothing else to a frame at rest; gui unit-test 1865/1871, two new failures under the jumps default walk, not fixed here: gui.zig "every pixel of a grip column is band, button or ring ..." (TestButtonUnderFirstRow, gui.zig:7232) and "the layer cover is the per-cell layer scan ..." (gui.zig:7127, `notices`: its `Msg` steps make no notice band since line C's notice row and E's prompts left the band); perfab refused (the pictures differ, as line C's); perfops 35 of 121 over 0.1%, all under the round's 10% but main's deep-sel (+52.8 to +57.4%): image-frame +5.64% (the notice row drawn every frame, line C's), edit-twin +2.19 to +2.78%, render per op +1.62 to +1.74%, client-key-down +0.99 to +1.51%, open on small +0.83%, the sessions' setups +0.12 to +1.46% (small and medium, once a session) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE --- core/lsp/Ask.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/lsp/Ask.zig b/core/lsp/Ask.zig index b6d32558..bb1eccb6 100644 --- a/core/lsp/Ask.zig +++ b/core/lsp/Ask.zig @@ -38,6 +38,10 @@ wait: ?struct { arg: Effect.Buf(128), row: i32 = 0, col: i32 = 0, + /// A hover asked from the keyboard where jumps walk (Pick.asked, when + /// asked: a 9P script's answer comes after its write): drawn as ghost + /// lines, no +Hover pane. + ghost: bool = false, } = null, /// A hover asked from the keyboard (where the walk is on), drawn as ghost /// lines under the line it was asked at in its own body (pick-ui SPEC §3.5, @@ -121,6 +125,7 @@ pub fn lspRequest(p: *Pardes, asked: usize, kind: lsp.Kind, arg_in: []const u8) .arg = .from(arg), .row = pane.body.cur_row, .col = pane.body.cur_col, + .ghost = kind == .hover and pardes.Pick.asked(p), }; p.emit(.{ .lsp = .{ .id = p.lsp_ask.seq, @@ -386,7 +391,7 @@ pub fn lspResponse(p: *Pardes, id: u32, response: ?[]const u8) void { // A hover asked from the keyboard: ghost lines in its own body, no // +Hover pane (SPEC §3.5). - if (w.kind == .hover and pardes.Pick.asked(p)) { + if (w.kind == .hover and w.ghost) { var cut = @min(rows.len, hover_max); while (cut < rows.len and cut > 0 and rows[cut] & 0xC0 == 0x80) cut -= 1; p.lsp_ask.hover = .{ .serial = pane.serial, .row = w.row, .revision = w.revision, .text = .from(rows[0..cut]) }; -- cgit v1.3