summaryrefslogtreecommitdiff
path: root/src/ide/complete.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-01-20 14:05:17 +0100
committerLaurenz <laurmaedje@gmail.com>2023-01-20 14:05:35 +0100
commitdd331f007cb9c9968605f8d3eaef8fb498c21322 (patch)
treef1b1490758ec53fd204724a325158d16c980d131 /src/ide/complete.rs
parent40561e57fbbc68becac07acd54a34f94f591f277 (diff)
Rewrite parser
Diffstat (limited to 'src/ide/complete.rs')
-rw-r--r--src/ide/complete.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ide/complete.rs b/src/ide/complete.rs
index 9e13fc8d..f0808b21 100644
--- a/src/ide/complete.rs
+++ b/src/ide/complete.rs
@@ -141,7 +141,7 @@ fn complete_params(ctx: &mut CompletionContext) -> bool {
if let Some(param) = before_colon.cast::<ast::Ident>();
then {
ctx.from = match ctx.leaf.kind() {
- SyntaxKind::Colon | SyntaxKind::Space { .. } => ctx.cursor,
+ SyntaxKind::Colon | SyntaxKind::Space => ctx.cursor,
_ => ctx.leaf.offset(),
};
ctx.named_param_value_completions(&callee, &param);
@@ -246,7 +246,7 @@ fn complete_symbols(ctx: &mut CompletionContext) -> bool {
/// Complete in markup mode.
fn complete_markup(ctx: &mut CompletionContext) -> bool {
// Bail if we aren't even in markup.
- if !matches!(ctx.leaf.parent_kind(), None | Some(SyntaxKind::Markup { .. })) {
+ if !matches!(ctx.leaf.parent_kind(), None | Some(SyntaxKind::Markup)) {
return false;
}
@@ -325,7 +325,7 @@ fn complete_math(ctx: &mut CompletionContext) -> bool {
fn complete_code(ctx: &mut CompletionContext) -> bool {
if matches!(
ctx.leaf.parent_kind(),
- None | Some(SyntaxKind::Markup { .. }) | Some(SyntaxKind::Math)
+ None | Some(SyntaxKind::Markup) | Some(SyntaxKind::Math)
) {
return false;
}
@@ -887,7 +887,7 @@ impl<'a> CompletionContext<'a> {
self.snippet_completion(
"import",
- "import ${items} from \"${file.typ}\"",
+ "import \"${file.typ}\": ${items}",
"Imports variables from another file.",
);