Clarify snippet escaping rules#1868
Merged
dbaeumer merged 2 commits intomicrosoft:gh-pagesfrom Jan 8, 2024
Merged
Conversation
The current text reads like you can escape $ and } where not strictly necessary, but according to VS Code's behaviour and microsoft/vscode#201059 this is not the case - you may only escape the characters that are _required_ to be escaped, otherwise you'll see backslashes in the output.
This was referenced Dec 19, 2023
dbaeumer
approved these changes
Jan 8, 2024
Member
|
Thanks! |
lramos15
approved these changes
Jan 8, 2024
copybara-service bot
pushed a commit
to dart-lang/sdk
that referenced
this pull request
Jan 11, 2024
We shouldn't escape $ or } in snippet choices because they are not ambiguous - VS Code would show unwanted backslashes. LSP spec was clarified here: microsoft/language-server-protocol#1868 Fixes #54403 Change-Id: If1134f067a8a73fe5ae678cadfbd2c284913d6c9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345661 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Phil Quitslund <pquitslund@google.com>
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.
The current text reads like you can escape $ and } where not strictly necessary, but according to VS Code's behaviour and microsoft/vscode#201059 this is not the case - you may only escape the characters that are required to be escaped, otherwise you'll see backslashes in the output.
VS Code Docs PR: microsoft/vscode-docs#6928