-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support multiple tab stops for completions in VSCode #16475
Merged
bors
merged 2 commits into
rust-lang:master
from
DropDemBits:native-vscode-snippet-text-edit
Feb 19, 2024
Merged
feat: Support multiple tab stops for completions in VSCode #16475
bors
merged 2 commits into
rust-lang:master
from
DropDemBits:native-vscode-snippet-text-edit
Feb 19, 2024
Conversation
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
rustbot
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Feb 2, 2024
DropDemBits
force-pushed
the
native-vscode-snippet-text-edit
branch
2 times, most recently
from
February 2, 2024 05:37
8753228
to
024f8b0
Compare
Veykril
approved these changes
Feb 9, 2024
Veykril
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Feb 9, 2024
DropDemBits
force-pushed
the
native-vscode-snippet-text-edit
branch
from
February 15, 2024 04:32
024f8b0
to
b0f4e07
Compare
Uses the native VSCode support for `SnippetTextEdit`s, but in a semi-hacky way as it's not fully supported yet.
We can't tell vscode to not add in the extra indentation, so we instead opt to remove it from the edits themselves, and then let vscode add it back in.
DropDemBits
force-pushed
the
native-vscode-snippet-text-edit
branch
from
February 15, 2024 23:39
b0f4e07
to
bcf14e2
Compare
Added the double indentation workaround. Initially decided to try and do the workaround in the server, but that turned out to be impossible 😅 @rustbot ready |
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Feb 15, 2024
Veykril
approved these changes
Feb 19, 2024
Thanks! |
☀️ Test successful - checks-actions |
This was referenced Feb 20, 2024
Closed
bors
added a commit
that referenced
this pull request
Feb 20, 2024
…-curly, r=Veykril fix: Don't add `\` before `{` Fixes #16607 for `{`. The `}` case is already fixed by #16475. The [LSP snippet grammar](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#snippet_syntax) only specifies that `$`, `}`, and `\` can be escaped with backslashes, but not `{`.
bors
added a commit
that referenced
this pull request
Feb 20, 2024
…-curly, r=Veykril fix: Don't add `\` before `{` Fixes #16607 for `{`. The `}` case is already fixed by #16475. The [LSP snippet grammar](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#snippet_syntax) only specifies that `$`, `}`, and `\` can be escaped with backslashes, but not `{`.
This was referenced May 9, 2024
This was referenced May 28, 2024
This was referenced Jun 11, 2024
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.
Uses the native VSCode support for
SnippetTextEdit
s. Fixes #13229 and fixes #8531.native-snippet-edits.mp4
This is done in a slightly hacky way, as
vscode-languageclient
can't convert RA'sSnippetTextEdit
s into vscodeSnippetTextEdit
s and will appear to use a different format in the future.Marked as draft since as-is, this will cause completions to double-indent any multi-line code generated.Update: This also fixes up edits so that any multi-line code won't be double-indented.