perf(lsp): batch progress updates and coalesce redraws - #297
Merged
Conversation
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.
Why
#293 restored LSP work-done progress, but the editor handled only one incoming LSP message per 10 ms background tick. A progress burst could therefore hold an already-available hover, completion, or diagnostic response for more than a second. Progress notifications also triggered full redraws even when Fidget was disabled.
What changed
A controlled debug-build probe queued 100 synthetic progress updates immediately before an available hover response:
How to Test
Run the focused queueing and redraw regressions:
Expect queued hover responses to complete in one background pass, a 65th message to remain queued for fairness, progress without Fidget to cause no redraw, and a Fidget burst to produce one redraw.
Open a Rust workspace, trigger
Kwhile rust-analyzer is indexing, and confirm hover appears promptly while the Fidget overlay continues to update.Add
disabled_plugins = ["fidget"]to the top level of the user config, repeat the same hover request during indexing, and confirm progress-only notifications no longer repaint the editor.Also verified: 2,077 library tests, 48 LSP integration tests, formatting, and
cargo clippy --all-targets --all-features -- -D warnings.