forked from zed-industries/zed
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve completion items once exactly (zed-industries#22448)
Closes zed-industries#19214 Closes zed-industries#22443 Adds `resolved` property into Zed completion item data, to ensure we resolve every completion item exactly once. There are 2 paths for singplayer Zed, and corresponding 2 analogues for multi player code, where resolve may happen: * completions menu display & selection, that ends up using `resolve_completions` in `lsp_store.rs` * applying a completion menu entry, that ends up using `apply_additional_edits_for_completion` in `lsp_store.rs` Now, all local counterparts check `enabled` field before resolving and set it to true afterwards, and reuse the same `resolve_completion_local` method for resolving the items. A logic for re-generating docs and item labels was moved out from the `resolve_completion_local` method into a separate method, as `apply_additional_edits_for_completion` does not need that, but needs the rest of the logic for resolving. During the extraction, I've noted that multiplayer clients are not getting the item labels, regenerated after the resolve — as the Zed protocol-based flow is not the exact copy of the local resolving. To improve that, `resolve_completion_remote` needs to be adjusted, but this change is omitted to avoid bloating the PR. Release Notes: - Fixed autocomplete inserting multiple imports
- Loading branch information
1 parent
d71180a
commit ed61abb
Showing
9 changed files
with
369 additions
and
199 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.