Skip to content

fix(lspd): only send didSave for files the agent wrote - #625

Merged
jcarver989 merged 1 commit into
mainfrom
fix/lspd-save-storm
Oct 23, 2026
Merged

jcarver989 merged 1 commit into
mainfrom
fix/lspd-save-storm

Conversation

@jcarver989

@jcarver989 jcarver989 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

aether-lspd sent didOpen + didSave on every document sync:

  • the bootstrap walk over every supported file in the workspace (~1,000 .rs files in this repo)
  • every position request (hover, definition, references, rename)
  • every file-watcher and server-requested (workspace/diagnostic/refresh) refresh

rust-analyzer restarts a workspace-wide cargo check on each didSave, so a single session spawned a new cargo check every 2–3 seconds, cancelling the previous one before it finished. Two sessions running at once kept several cores busy and used ~9 GB of RAM in rust-analyzer.

Every document sync sent didOpen followed by didSave, including the
startup walk over every workspace file, each hover/definition request,
and every watcher or server-requested refresh. rust-analyzer restarts a
workspace-wide cargo check on each save, so a session spawned a new
cargo check every few seconds and never let one finish, pinning the
CPU for the whole bootstrap.

didSave is now sent only for files queued via queue_diagnostic_refresh,
which is how the agent reports its own edits.
@jcarver989
jcarver989 enabled auto-merge (squash) October 23, 2026 22:46
@jcarver989
jcarver989 merged commit 461caf7 into main Oct 23, 2026
16 checks passed
@jcarver989
jcarver989 deleted the fix/lspd-save-storm branch October 23, 2026 22:51
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