Skip to content

Commit

Permalink
fix: remove redundant default_postfix_snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Song-Nop committed Dec 12, 2024
1 parent e69a8a9 commit 12e74bb
Showing 1 changed file with 0 additions and 95 deletions.
95 changes: 0 additions & 95 deletions crates/tinymist-query/src/upstream/complete/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1807,101 +1807,6 @@ pub fn symbol_label_detail(ch: char) -> EcoString {
}
}

static DEFAULT_POSTFIX_SNIPPET: LazyLock<Vec<PostfixSnippet>> = 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<Regex> =
Lazy::new(|| Regex::new(r"\$\{(.*?)\}").unwrap());
/// Adds numbering to placeholders in snippets
Expand Down

0 comments on commit 12e74bb

Please sign in to comment.