mirror of
https://github.com/microsoft/language-server-protocol.git
synced 2025-12-23 08:48:16 +00:00
Clarify snippet escaping rules (#1868)
The current text reads like you can escape $ and } where not strictly necessary, but according to VS Code's behaviour and https://github.com/microsoft/vscode/issues/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. Co-authored-by: Dirk Bäumer <dirkb@microsoft.com>
This commit is contained in:
parent
74c0687735
commit
ebd89361c2
1 changed files with 1 additions and 1 deletions
|
|
@ -814,7 +814,7 @@ ${TM_FILENAME/(.*)\..+$/$1/}
|
|||
|
||||
##### Grammar
|
||||
|
||||
Below is the EBNF ([extended Backus-Naur form](https://en.wikipedia.org/wiki/Extended_Backus-Naur_form)) for snippets. With `\` (backslash), you can escape `$`, `}` and `\`. Within choice elements, the backslash also escapes comma and pipe characters.
|
||||
Below is the EBNF ([extended Backus-Naur form](https://en.wikipedia.org/wiki/Extended_Backus-Naur_form)) for snippets. With `\` (backslash), you can escape `$`, `}` and `\`. Within choice elements, the backslash also escapes comma and pipe characters. Only the characters required to be escaped can be escaped, so `$` should not be escaped within these constructs and neither `$` or `}` should be escaped inside choice constructs.
|
||||
|
||||
```
|
||||
any ::= tabstop | placeholder | choice | variable | text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue