mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-23 04:35:00 +00:00
fix: avoid duplicated method completion (#349)
This commit is contained in:
parent
a3724bc87f
commit
0a1c625397
1 changed files with 1 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue