on master help sign in
allow empty placeholders
f87299fPascal Kuthe
helix-lsp/src/snippet.rs+6−1
@@ -336,7 +336,12 @@ mod parser {
336 "${",
336 "${",
337 digit(),
337 digit(),
338 ":",
338 ":",
339+ // according to the grammar there is just a single anything here.
340+ // However in the procese it is explained that placeholders can be nested
341+ // the example there contains both a placeholder text and a nested placeholder
342+ // which indicates a list. Looking at the VSCode sourcecode, the placeholder
343+ // is indeed parsed as zero_or_more so the grammar is simply incorrect here
339− one_or_more(anything(TEXT_ESCAPE_CHARS)),
344+ zero_or_more(anything(TEXT_ESCAPE_CHARS)),
340 "}"
345 "}"
341 ),
346 ),
342 |seq| SnippetElement::Placeholder {
347 |seq| SnippetElement::Placeholder {