Repository navigation
fix(lspd): only send didSave for files the agent wrote - #625
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
aether-lspdsentdidOpen+didSaveon every document sync:.rsfiles in this repo)workspace/diagnostic/refresh) refreshrust-analyzer restarts a workspace-wide
cargo checkon eachdidSave, so a single session spawned a newcargo checkevery 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.