Repository navigation
fix(completion): rebase refreshed edits from their request - #313
Merged
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
Accepting a refreshed completion can close the popup without changing the buffer. Red reuses the popup's original snapshot for newer buffer-word and language-server candidates, even though their edits already target the newer document revision. The edit is rebased twice and rejected with an error such as
LSP position 319:25 is outside its line. Older completion responses can also arrive after newer requests and replace current candidates.What changed
How to Test
self.app_event_tx, insert a new line, and typeself.appwhile the completion popup refreshes. Selectapp_event_txand press Enter; the member should replaceappwithout anoutside its lineerror.cargo test --lib refreshed_; all three targeted stale-snapshot and out-of-order regressions should pass.cargo test --lib completionandcargo test --test completion; the 144 completion-related unit tests and 46 integration tests should pass.cargo clippy --all-targets --all-features -- -D warnings; it should finish without warnings.