Skip to content

Commit 39bdf54

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 dabf8b2 commit 39bdf54

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
@@ -818,10 +818,10 @@ Below is the grammar for snippets in EBNF ([extended Backus-Naur form, XML varia
818818
```
819819
any ::= tabstop | placeholder | choice | variable | text
820820
tabstop ::= '$' int | '${' int '}'
821-
placeholder ::= '${' int ':' any '}'
821+
placeholder ::= '${' int ':' any+ '}'
822822
choice ::= '${' int '|' choicetext (',' choicetext)* '|}'
823823
variable ::= '$' var | '${' var }'
824-
| '${' var ':' any '}'
824+
| '${' var ':' any+ '}'
825825
| '${' var '/' regex '/' (format | formattext)* '/' options '}'
826826
format ::= '$' int | '${' int '}'
827827
/* Transforms the text to be uppercase, lowercase, or capitalized, respectively. */

0 commit comments

Comments
 (0)