summaryrefslogtreecommitdiff
path: root/dev/lsp
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 20:55:36 -0300
committerGabriel Schneider <[email protected]>2026-11-19 23:43:13 -0300
commit165f1f61a20dd95a9018177d66e6f4f40a4cb320 (patch)
treeb31f15eeb5b1e744152f8fe6b570c9dc1e42d038 /dev/lsp
parentb92578b797e6907a355b23f52b9b5202aa5967e0 (diff)
downloadpardes-165f1f61a20dd95a9018177d66e6f4f40a4cb320.tar.gz
pardes-165f1f61a20dd95a9018177d66e6f4f40a4cb320.zip
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 "<server> 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)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev/lsp')
-rw-r--r--dev/lsp/lsp_client.zig9
1 files changed, 7 insertions, 2 deletions
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);