-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: let LSP autocompletion work in more contexts (#5719)
# Description ## Problem There were a couple of contexts where autocompletion wouldn't trigger. This PR fixes some of these. ## Summary ### Autocompletion inside if condition without following body Before: ![lsp-autocomplete-if-before](https://github.com/user-attachments/assets/e4d96573-9c96-4ab7-b5b7-7c99a87c4b3a) After: ![lsp-autocomplete-if-after](https://github.com/user-attachments/assets/318569b2-9556-41f1-bd63-c68eda3e7371) ### Autocompletion in nested expression Before: ![lsp-autocomplete-nested-before](https://github.com/user-attachments/assets/ef1aa9f8-4c30-4796-9672-dc54af913b69) The reason is that is was autocompleting for the type of `foo.bar & foo` instead of just `foo`. After: ![lsp-autocomplete-nested-after](https://github.com/user-attachments/assets/98c28c43-029d-4305-ba41-18f2697ba58f) ### Autocompletion in call chains Before: ![lsp-autocomplete-chain-before](https://github.com/user-attachments/assets/d2d3e4f5-3b00-4f80-bd37-25cf76288d8e) After: ![lsp-autocomplete-chain-after](https://github.com/user-attachments/assets/bead94ba-55d2-40f1-896e-58625fd7f542) ### Autocompletion when assignment follows Before: ![lsp-autocomplete-assignment-follows-before](https://github.com/user-attachments/assets/80a5db63-bcd3-421a-85e4-9acdfec79763) After: ![lsp-autocomplete-assignment-follows-after](https://github.com/user-attachments/assets/328a2a83-959a-4252-b974-17f547f7fc13) ## Additional Context I might send a follow-up PR to split `completion.rs` into several files because it's getting pretty big. For example tests could go in a separate file. ## Documentation Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
- Loading branch information
Showing
4 changed files
with
159 additions
and
19 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