Skip to content

Commit f87299f

Browse files
pascalkuthearchseer
authored andcommitted
allow empty placeholders
1 parent 90348b8 commit f87299f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

helix-lsp/src/snippet.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,12 @@ mod parser {
336336
"${",
337337
digit(),
338338
":",
339-
one_or_more(anything(TEXT_ESCAPE_CHARS)),
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
344+
zero_or_more(anything(TEXT_ESCAPE_CHARS)),
340345
"}"
341346
),
342347
|seq| SnippetElement::Placeholder {

0 commit comments

Comments
 (0)