From 0a1c62539751eb9b9076bde0cfd9bbdbbcafa5a9 Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:00:08 +0800 Subject: [PATCH] fix: avoid duplicated method completion (#349) --- crates/tinymist-query/src/upstream/complete.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/crates/tinymist-query/src/upstream/complete.rs b/crates/tinymist-query/src/upstream/complete.rs index f8cc81d6..27a822fc 100644 --- a/crates/tinymist-query/src/upstream/complete.rs +++ b/crates/tinymist-query/src/upstream/complete.rs @@ -5,9 +5,7 @@ use std::ops::Range; use ecow::{eco_format, EcoString}; use if_chain::if_chain; use serde::{Deserialize, Serialize}; -use typst::foundations::{ - fields_on, format_str, mutable_methods_on, repr, Repr, StyleChain, Styles, Value, -}; +use typst::foundations::{fields_on, format_str, repr, Repr, StyleChain, Styles, Value}; use typst::model::Document; use typst::syntax::ast::AstNode; use typst::syntax::{ast, is_id_continue, is_id_start, is_ident, LinkedNode, Source, SyntaxKind}; @@ -402,19 +400,6 @@ fn field_access_completions(ctx: &mut CompletionContext, value: &Value, styles: } } - for &(method, args) in mutable_methods_on(value.ty()) { - ctx.completions.push(Completion { - kind: CompletionKind::Func, - label: method.into(), - apply: Some(if args { - eco_format!("{method}(${{}})") - } else { - eco_format!("{method}()${{}}") - }), - ..Completion::default() - }) - } - for &field in fields_on(value.ty()) { // Complete the field name along with its value. Notes: // 1. No parentheses since function fields cannot currently be called