mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 18:28:02 +00:00
fix: typos in tinymist-query
(#956)
This commit is contained in:
parent
0d40da4ada
commit
9efc3d55d5
2 changed files with 9 additions and 9 deletions
|
@ -191,7 +191,7 @@ fn complete_markup(ctx: &mut CompletionContext) -> bool {
|
|||
}
|
||||
|
||||
// Anywhere: "|".
|
||||
if !is_triggerred_by_punc(ctx.trigger_character) && ctx.explicit {
|
||||
if !is_triggered_by_punc(ctx.trigger_character) && ctx.explicit {
|
||||
ctx.from = ctx.cursor;
|
||||
markup_completions(ctx);
|
||||
return true;
|
||||
|
@ -320,7 +320,7 @@ fn complete_math(ctx: &mut CompletionContext) -> bool {
|
|||
}
|
||||
|
||||
// Behind existing atom or identifier: "$a|$" or "$abc|$".
|
||||
if !is_triggerred_by_punc(ctx.trigger_character)
|
||||
if !is_triggered_by_punc(ctx.trigger_character)
|
||||
&& matches!(ctx.leaf.kind(), SyntaxKind::Text | SyntaxKind::MathIdent)
|
||||
{
|
||||
ctx.from = ctx.leaf.offset();
|
||||
|
@ -329,7 +329,7 @@ fn complete_math(ctx: &mut CompletionContext) -> bool {
|
|||
}
|
||||
|
||||
// Anywhere: "$|$".
|
||||
if !is_triggerred_by_punc(ctx.trigger_character) && ctx.explicit {
|
||||
if !is_triggered_by_punc(ctx.trigger_character) && ctx.explicit {
|
||||
ctx.from = ctx.cursor;
|
||||
math_completions(ctx);
|
||||
return true;
|
||||
|
@ -547,7 +547,7 @@ fn complete_imports(ctx: &mut CompletionContext) -> bool {
|
|||
}
|
||||
|
||||
// Behind a half-started identifier in an import list:
|
||||
// "#import "path.typ": thi|",
|
||||
// "#import "path.typ": th|",
|
||||
if_chain! {
|
||||
if matches!(ctx.leaf.kind(), SyntaxKind::Ident | SyntaxKind::Dot);
|
||||
if let Some(path_ctx) = ctx.leaf.clone().parent();
|
||||
|
@ -1168,6 +1168,6 @@ fn slice_at(s: &str, mut rng: Range<usize>) -> &str {
|
|||
&s[rng]
|
||||
}
|
||||
|
||||
fn is_triggerred_by_punc(trigger_character: Option<char>) -> bool {
|
||||
fn is_triggered_by_punc(trigger_character: Option<char>) -> bool {
|
||||
trigger_character.is_some_and(|c| c.is_ascii_punctuation())
|
||||
}
|
||||
|
|
|
@ -607,7 +607,7 @@ fn check_surrounding_syntax(mut leaf: &LinkedNode) -> Option<SurroundingSyntax>
|
|||
}
|
||||
SyntaxKind::SetRule => {
|
||||
let rule = parent.get().cast::<ast::SetRule>()?;
|
||||
if met_args || encolsed_by(parent, rule.condition().map(|s| s.span()), leaf) {
|
||||
if met_args || enclosed_by(parent, rule.condition().map(|s| s.span()), leaf) {
|
||||
return Some(Regular);
|
||||
} else {
|
||||
return Some(SetRule);
|
||||
|
@ -963,7 +963,7 @@ impl FnCompletionFeat {
|
|||
}
|
||||
}
|
||||
|
||||
fn encolsed_by(parent: &LinkedNode, s: Option<Span>, leaf: &LinkedNode) -> bool {
|
||||
fn enclosed_by(parent: &LinkedNode, s: Option<Span>, leaf: &LinkedNode) -> bool {
|
||||
s.and_then(|s| parent.find(s)?.find(leaf.span())).is_some()
|
||||
}
|
||||
|
||||
|
@ -1417,13 +1417,13 @@ pub(crate) fn complete_type(ctx: &mut CompletionContext) -> Option<()> {
|
|||
}
|
||||
|
||||
let mut completions = std::mem::take(&mut ctx.completions);
|
||||
let explict = ctx.explicit;
|
||||
let explicit = ctx.explicit;
|
||||
ctx.explicit = true;
|
||||
let ty = Some(Ty::from_types(ctx.seen_types.iter().cloned()));
|
||||
let from_ty = std::mem::replace(&mut ctx.from_ty, ty);
|
||||
complete_code(ctx, true);
|
||||
ctx.from_ty = from_ty;
|
||||
ctx.explicit = explict;
|
||||
ctx.explicit = explicit;
|
||||
|
||||
match scope {
|
||||
SurroundingSyntax::Regular => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue