Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/snippets/elaborate.rs')
| -rw-r--r-- | helix-core/src/snippets/elaborate.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/helix-core/src/snippets/elaborate.rs b/helix-core/src/snippets/elaborate.rs index b17c149f..0fb5fb7b 100644 --- a/helix-core/src/snippets/elaborate.rs +++ b/helix-core/src/snippets/elaborate.rs @@ -178,16 +178,9 @@ impl Snippet { &mut self, idx: usize, parent: Option<TabstopIdx>, - mut default: Vec<parser::SnippetElement>, + default: Vec<parser::SnippetElement>, ) -> TabstopIdx { let idx = TabstopIdx::elaborate(idx); - if idx == LAST_TABSTOP_IDX && !default.is_empty() { - // Older versions of clangd for example may send a snippet like `${0:placeholder}` - // which is considered by VSCode to be a misuse of the `$0` tabstop. - log::warn!("Discarding placeholder text for the `$0` tabstop ({default:?}). \ - The `$0` tabstop signifies the final cursor position and should not include placeholder text."); - default.clear(); - } let default = self.elaborate(default, Some(idx)); self.tabstops.push(Tabstop { idx, @@ -361,7 +354,7 @@ impl Transform { } } FormatItem::Conditional(i, ref if_, ref else_) => { - if cap.get_group(i).is_none_or(|mat| mat.is_empty()) { + if cap.get_group(i).map_or(true, |mat| mat.is_empty()) { buf.push_str(else_) } else { buf.push_str(if_) |