-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vscode): completions for
bring
and hiding more irrelevant comp…
…letions (#4433) #### Stops completions on the left side of variable declarations ##### Fixes #3991 <img width="331" alt="image" src="https://github.com/winglang/wing/assets/1237390/5c5c7fed-c416-41ec-ba66-b2b3628d5597"> #### Stops completions in the `in` part of `for in` (prevent the common annoying `inflight` completions) ##### Fixes #3997 <img width="377" alt="image" src="https://github.com/winglang/wing/assets/1237390/ab776893-6cea-4aed-a4d5-bcee27025964"> #### Adds completions for `bring` (and prevent irrelevant completions) ##### Fixes #3975 <img width="599" alt="image" src="https://github.com/winglang/wing/assets/1237390/8118cce8-c2f6-49fb-8f72-0564062dfa82"> _Didn't add documentation for them yet, wasn't sure how to go about it without some duplicated hardcoding._ --- Misc: - `bring` followed by a single character previously caused a panic (e.g. `bring c`). Most people probably didn't notice cause they were typing `bring cloud` so fast - No completions in comments or strings - Tried to centralize many of the cases where it's obvious there will be no completions available. `completions.rs` is still begging for a rewrite. *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
- Loading branch information
1 parent
a496713
commit fc47625
Showing
13 changed files
with
282 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: libs/wingc/src/lsp/completions.rs | ||
--- | ||
[] | ||
|
30 changes: 30 additions & 0 deletions
30
libs/wingc/src/lsp/snapshots/completions/bring_suggestions.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: libs/wingc/src/lsp/completions.rs | ||
--- | ||
- label: aws | ||
kind: 9 | ||
sortText: kk|aws | ||
- label: cloud | ||
kind: 9 | ||
sortText: kk|cloud | ||
- label: ex | ||
kind: 9 | ||
sortText: kk|ex | ||
- label: http | ||
kind: 9 | ||
sortText: kk|http | ||
- label: math | ||
kind: 9 | ||
sortText: kk|math | ||
- label: regex | ||
kind: 9 | ||
sortText: kk|regex | ||
- label: util | ||
kind: 9 | ||
sortText: kk|util | ||
- label: "\"module\"" | ||
kind: 15 | ||
sortText: "ll|\"module\"" | ||
insertText: "\"$1\" as $2" | ||
insertTextFormat: 2 | ||
|
30 changes: 30 additions & 0 deletions
30
libs/wingc/src/lsp/snapshots/completions/bring_suggestions_partial.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: libs/wingc/src/lsp/completions.rs | ||
--- | ||
- label: aws | ||
kind: 9 | ||
sortText: kk|aws | ||
- label: cloud | ||
kind: 9 | ||
sortText: kk|cloud | ||
- label: ex | ||
kind: 9 | ||
sortText: kk|ex | ||
- label: http | ||
kind: 9 | ||
sortText: kk|http | ||
- label: math | ||
kind: 9 | ||
sortText: kk|math | ||
- label: regex | ||
kind: 9 | ||
sortText: kk|regex | ||
- label: util | ||
kind: 9 | ||
sortText: kk|util | ||
- label: "\"module\"" | ||
kind: 15 | ||
sortText: "ll|\"module\"" | ||
insertText: "\"$1\" as $2" | ||
insertTextFormat: 2 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: libs/wingc/src/lsp/completions.rs | ||
--- | ||
[] | ||
|
5 changes: 5 additions & 0 deletions
5
libs/wingc/src/lsp/snapshots/completions/definition_identifier.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: libs/wingc/src/lsp/completions.rs | ||
--- | ||
[] | ||
|
5 changes: 5 additions & 0 deletions
5
libs/wingc/src/lsp/snapshots/completions/definition_identifier_partial.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: libs/wingc/src/lsp/completions.rs | ||
--- | ||
[] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: libs/wingc/src/lsp/completions.rs | ||
--- | ||
[] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: libs/wingc/src/lsp/completions.rs | ||
--- | ||
[] | ||
|
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