From ebd89361c2573e2a2bf844481c23edecfb1823db Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Mon, 8 Jan 2024 18:31:37 +0000 Subject: [PATCH] Clarify snippet escaping rules (#1868) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- _specifications/lsp/3.18/language/completion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_specifications/lsp/3.18/language/completion.md b/_specifications/lsp/3.18/language/completion.md index fa1c5f7..6a793d9 100644 --- a/_specifications/lsp/3.18/language/completion.md +++ b/_specifications/lsp/3.18/language/completion.md @@ -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