Skip to content

lsp: diagnostics one-shot and --wait report published diagnostics - #28

Closed
mgasner wants to merge 1 commit into
fix/lsp-hoverfrom
fix/lsp-diagnostics
Closed

mgasner wants to merge 1 commit into
fix/lsp-hoverfrom
fix/lsp-diagnostics

Conversation

@mgasner

@mgasner mgasner commented Sep 28, 2026

Copy link
Copy Markdown

Stacked on #27; the diff shows only this change.

yas lsp diagnostics without --watch printed nothing and exited 0, even when errors existed. The initial snapshot from run_lsp_watch held only buffers, and the engine's retained diagnostics arrived later as a Reset. --wait didn't help: it waited only for READY, which comes before rust-analyzer publishes its check results.

Fix

  • A diagnostics subscription's initial snapshot now waits for the engine's first diagnostics replay, which is always sent on attach.
  • --wait now keeps watching diagnostics and backend state after READY. It prints on the first publish that changes the diagnostic set, or after 5 seconds with no server update, so a clean workspace still returns. (An empty set can't be told apart from no publish on the wire, hence the 5-second fallback.)
  • The lsp --root help (9 flags) now says the path is relative to the client's cwd. learn.md now uses the real Busy: Warming error.

Testing

Checked by hand with rust-analyzer:

  • diag and diag --wait show the E0308 error and exit 1.
  • After an edit that fixes the error, --wait returns 0 in about 0.7 s.
  • After breaking the code again, the new error prints.

View in Indent
Tag @indent to continue the conversation here.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Coverage

Crate Lines Functions Regions
alacritty-driver 85.6% (1081/1263) 89.4% (84/94) 89.3% (1746/1955)
browser 25.5% (309/1212) 30.4% (34/112) 27.7% (605/2183)
cli 34.2% (6797/19888) 36.3% (644/1776) 35.3% (10102/28632)
client 68.3% (5800/8497) 68.5% (708/1033) 66.4% (7526/11331)
composite-transport 96.3% (526/546) 98.4% (60/61) 96.2% (884/919)
compositor 55.1% (11466/20820) 66.5% (841/1265) 55.0% (15890/28909)
desktop 78.4% (4460/5691) 71.6% (393/549) 75.1% (6211/8267)
edge 62.8% (796/1268) 50.9% (82/161) 57.4% (1033/1799)
fonts 77.3% (1257/1626) 82.7% (129/156) 78.9% (2424/3071)
fssync 86.0% (1610/1872) 85.8% (182/212) 87.1% (2834/3255)
git 72.9% (4622/6344) 70.5% (347/492) 70.1% (6590/9407)
guest 67.3% (6829/10148) 67.0% (488/728) 66.6% (8935/13416)
lsp 79.9% (3641/4558) 81.3% (340/418) 77.7% (5489/7068)
proxy 63.1% (1902/3012) 56.3% (184/327) 63.4% (2931/4626)
runtime-dir 93.6% (117/125) 100.0% (14/14) 94.8% (218/230)
sd-notify 73.9% (68/92) 100.0% (6/6) 83.2% (109/131)
server 71.5% (86226/120661) 74.1% (6258/8448) 69.4% (115554/166414)
ssh 67.2% (708/1054) 75.9% (85/112) 67.2% (1105/1645)
terminal-model 49.9% (314/629) 62.3% (38/61) 50.3% (505/1004)
uplink 94.2% (582/618) 92.6% (50/54) 93.1% (1062/1141)
webrtc-forwarder 33.6% (1321/3932) 44.9% (146/325) 36.0% (2279/6336)
webserver 80.7% (1490/1846) 81.1% (193/238) 83.2% (2551/3067)
website 35.1% (355/1012) 34.4% (53/154) 35.8% (607/1694)
xtask 0.0% (0/5149) 0.0% (0/131) 0.0% (0/9157)
yas 89.0% (28040/31522) 94.1% (2152/2286) 84.1% (44040/52388)
Total 67.2% (170317/253385) 70.3% (13511/19213) 65.5% (241230/368045)

@indent
indent Bot force-pushed the fix/lsp-hover branch from 916da7b to 2385923 Compare October 14, 2026 19:08
@indent
indent Bot force-pushed the fix/lsp-diagnostics branch 2 times, most recently from 0d04d90 to bc62863 Compare October 14, 2026 19:32
@indent
indent Bot force-pushed the fix/lsp-hover branch from 2385923 to 616645a Compare October 14, 2026 19:32
@indent
indent Bot force-pushed the fix/lsp-diagnostics branch from bc62863 to f6b8b37 Compare October 14, 2026 19:54
@indent
indent Bot force-pushed the fix/lsp-hover branch from 616645a to 2d484e2 Compare October 14, 2026 19:54
run_lsp_watch sent a buffer-only initial snapshot and delivered the
engine's retained diagnostics only as a later Reset, so one-shot
`yas lsp diagnostics` always printed nothing and exited 0. The initial
snapshot of a diagnostics subscription now waits for the engine's first
diagnostics replay.

--wait now waits for indexing, then for the next published diagnostics,
ending after 5 seconds without any server update so a clean workspace
still returns.

Help: lsp --root is relative to the client's cwd, not the server's;
learn.md names the actual `Busy: Warming` error.
@indent
indent Bot force-pushed the fix/lsp-diagnostics branch from f6b8b37 to 974ee7b Compare October 15, 2026 01:43
@indent
indent Bot force-pushed the fix/lsp-hover branch from 2d484e2 to bd7d77b Compare October 15, 2026 01:43
@indent indent Bot closed this Oct 15, 2026
@indent
indent Bot deleted the fix/lsp-diagnostics branch October 15, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant