Skip to content

Commit ceb1ada

Browse files
committed
Clarify snippet placeholder structure
Now grammar implies that placeholder value should be a single `any` node, while in most applications it can be any number of consecutive `any` nodes. For example, as described in earlier "Placeholders" section: `${1:another ${2:placeholder}}`. Adding `+` quantifier to `any` seems to be more precise. This seems to also fix the grammar for initial snippet input (which is implied to be `any`).
1 parent 90e7853 commit ceb1ada

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_specifications/lsp/3.18/language/completion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ ${TM_FILENAME/(.*)\..+$/$1/}
934934
Below is the grammar for snippets in EBNF ([extended Backus-Naur form, XML variant](https://www.w3.org/TR/xml/#sec-notation)). 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 `$` nor `}` should be escaped inside choice constructs.
935935

936936
```
937-
any ::= tabstop | placeholder | choice | variable | text
937+
any ::= (tabstop | placeholder | choice | variable | text)+
938938
tabstop ::= '$' int | '${' int '}'
939939
placeholder ::= '${' int ':' any '}'
940940
choice ::= '${' int '|' choicetext (',' choicetext)* '|}'

0 commit comments

Comments
 (0)