diff --git a/crates/tinymist-query/src/upstream/complete/ext.rs b/crates/tinymist-query/src/upstream/complete/ext.rs index 57a4a951b..43f12dc2a 100644 --- a/crates/tinymist-query/src/upstream/complete/ext.rs +++ b/crates/tinymist-query/src/upstream/complete/ext.rs @@ -1807,101 +1807,6 @@ pub fn symbol_label_detail(ch: char) -> EcoString { } } -static DEFAULT_POSTFIX_SNIPPET: LazyLock> = LazyLock::new(|| { - vec![ - PostfixSnippet { - scope: PostfixSnippetScope::Content, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: eco_format!("text fill"), - label_detail: Some(eco_format!(".text fill")), - snippet: "text(fill: ${}, ${node})".into(), - description: eco_format!("wrap with text fill"), - parsed_snippet: OnceLock::new(), - }, - PostfixSnippet { - scope: PostfixSnippetScope::Content, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: eco_format!("text size"), - label_detail: Some(eco_format!(".text size")), - snippet: "text(size: ${}, ${node})".into(), - description: eco_format!("wrap with text size"), - parsed_snippet: OnceLock::new(), - }, - PostfixSnippet { - scope: PostfixSnippetScope::Content, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: eco_format!("align"), - label_detail: Some(eco_format!(".align")), - snippet: "align(${}, ${node})".into(), - description: eco_format!("wrap with alignment"), - parsed_snippet: OnceLock::new(), - }, - PostfixSnippet { - scope: PostfixSnippetScope::Value, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: "if".into(), - label_detail: Some(".if".into()), - snippet: "if ${node} { ${} }".into(), - description: "wrap as if expression".into(), - parsed_snippet: OnceLock::new(), - }, - PostfixSnippet { - scope: PostfixSnippetScope::Value, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: "else".into(), - label_detail: Some(".else".into()), - snippet: "if not ${node} { ${} }".into(), - description: "wrap as if not expression".into(), - parsed_snippet: OnceLock::new(), - }, - PostfixSnippet { - scope: PostfixSnippetScope::Value, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: "none".into(), - label_detail: Some(".if none".into()), - snippet: "if ${node} == none { ${} }".into(), - description: "wrap as if expression to check none-ish".into(), - parsed_snippet: OnceLock::new(), - }, - PostfixSnippet { - scope: PostfixSnippetScope::Value, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: "notnone".into(), - label_detail: Some(".if not none".into()), - snippet: "if ${node} != none { ${} }".into(), - description: "wrap as if expression to check none-ish".into(), - parsed_snippet: OnceLock::new(), - }, - PostfixSnippet { - scope: PostfixSnippetScope::Value, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: "return".into(), - label_detail: Some(".return".into()), - snippet: "return ${node}".into(), - description: "wrap as return expression".into(), - parsed_snippet: OnceLock::new(), - }, - PostfixSnippet { - scope: PostfixSnippetScope::Value, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: "tup".into(), - label_detail: Some(".tup".into()), - snippet: "(${node}, ${})".into(), - description: "wrap as tuple (array) expression".into(), - parsed_snippet: OnceLock::new(), - }, - PostfixSnippet { - scope: PostfixSnippetScope::Value, - mode: eco_vec![InterpretMode::Code, InterpretMode::Markup], - label: "let".into(), - label_detail: Some(".let".into()), - snippet: "let ${_} = ${node}".into(), - description: "wrap as let expression".into(), - parsed_snippet: OnceLock::new(), - }, - ] -}); - static TYPST_SNIPPET_PLACEHOLDER_RE: Lazy = Lazy::new(|| Regex::new(r"\$\{(.*?)\}").unwrap()); /// Adds numbering to placeholders in snippets