Skip to content

Commit 96ca492

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}}`. Using `any+` instead of `any` seems to be more precise.
1 parent 90e7853 commit 96ca492

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_specifications/lsp/3.18/language/completion.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -936,10 +936,10 @@ Below is the grammar for snippets in EBNF ([extended Backus-Naur form, XML varia
936936
```
937937
any ::= tabstop | placeholder | choice | variable | text
938938
tabstop ::= '$' int | '${' int '}'
939-
placeholder ::= '${' int ':' any '}'
939+
placeholder ::= '${' int ':' any+ '}'
940940
choice ::= '${' int '|' choicetext (',' choicetext)* '|}'
941941
variable ::= '$' var | '${' var }'
942-
| '${' var ':' any '}'
942+
| '${' var ':' any+ '}'
943943
| '${' var '/' regex '/' (format | formattext)* '/' options '}'
944944
format ::= '$' int | '${' int '}'
945945
/* Transforms the text to be uppercase, lowercase, or capitalized, respectively. */

0 commit comments

Comments
 (0)