aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Kuthe2023-03-13 18:30:58 +0000
committerBlaž Hrastnik2023-03-16 06:46:08 +0000
commitf87299f1b7512ac06e96c77eeb22459389573ada (patch)
tree6ecd2ec7435db820c1a44dfcce0c209af64493df
parent90348b889f397f2753473764c2d7a02986beddeb (diff)
allow empty placeholders
-rw-r--r--helix-lsp/src/snippet.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/helix-lsp/src/snippet.rs b/helix-lsp/src/snippet.rs
index f64f29f2..13e7609f 100644
--- a/helix-lsp/src/snippet.rs
+++ b/helix-lsp/src/snippet.rs
@@ -336,7 +336,12 @@ mod parser {
"${",
digit(),
":",
- one_or_more(anything(TEXT_ESCAPE_CHARS)),
+ // according to the grammar there is just a single anything here.
+ // However in the procese it is explained that placeholders can be nested
+ // the example there contains both a placeholder text and a nested placeholder
+ // which indicates a list. Looking at the VSCode sourcecode, the placeholder
+ // is indeed parsed as zero_or_more so the grammar is simply incorrect here
+ zero_or_more(anything(TEXT_ESCAPE_CHARS)),
"}"
),
|seq| SnippetElement::Placeholder {