From 165f1f61a20dd95a9018177d66e6f4f40a4cb320 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 20:55:36 -0300 Subject: lsp: "still loading the workspace" is said only when the server says it, so lspcomplete and lspcompletemoved pass: an empty answer inside the 250 ms after the server's initialize waits out that window for a progress notification and asks again, which stays, but it also posted " is still loading the workspace; the answer comes when it is done…" whether or not the server had said anything (`starting` alone, dev/lsp/lsp_client.zig:785), and zls says nothing, so the message was false and stayed on the message row after the (empty, right) answer; a Tab in a comment, the tests' first query, always lands in that window, so both failed on every base (their goldens' only difference); now the message and the trace's note need `c.loading` or `c.progress > 0`; a user saw it on the first completion after zls started; after, both 0 of 35 runs under load 46-65 (15 more lost to a cache wipe) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- dev/lsp/lsp_client.zig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'dev') diff --git a/dev/lsp/lsp_client.zig b/dev/lsp/lsp_client.zig index 83aea44f..4ad8dace 100644 --- a/dev/lsp/lsp_client.zig +++ b/dev/lsp/lsp_client.zig @@ -783,8 +783,13 @@ fn answer(io: std.Io, arena: std.mem.Allocator, si: usize, req: lsp.Req, out: *s if (!try timedWait(c, io, startup_deadline)) break; } if (starting or c.loading or c.progress > 0) { - tr.note("{s} is still loading: waiting for it, then asking again", .{specs[si].name}); - post(si, .always, "{s} is still loading the workspace; the answer comes when it is done\u{2026}", .{specs[si].name}); + // Said only when the server says it: a startup window that ran + // out with no word of loading is asked again quietly, and the + // message row keeps what it had (an empty answer is an answer). + if (c.loading or c.progress > 0) { + tr.note("{s} is still loading: waiting for it, then asking again", .{specs[si].name}); + post(si, .always, "{s} is still loading the workspace; the answer comes when it is done\u{2026}", .{specs[si].name}); + } while ((c.loading or c.progress > 0) and c.gen == g and c.alive()) _ = try timedWait(c, io, nowMs() + 500); out.end = before; try attempt(c, io, si, arena, req, out, tr, g); -- cgit v1.3