refactor: final touch and complete matchers (#1036)

* perf: minor optimize matches to dot access

* refactor: final touch and complete matchers

* dev: change name back
This commit is contained in:
Myriad-Dreamin 2024-12-20 20:56:45 +08:00 committed by GitHub
parent 980571ad61
commit 1eb63870fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 419 additions and 346 deletions

View file

@ -4,7 +4,7 @@ use typst_shim::syntax::LinkedNodeExt;
use crate::{
adt::interner::Interned,
prelude::*,
syntax::{classify_cursor, classify_syntax, ArgClass, CursorClass},
syntax::{classify_context, classify_syntax, ArgClass, SyntaxContext},
LspParamInfo, SemanticRequest,
};
@ -28,12 +28,12 @@ impl SemanticRequest for SignatureHelpRequest {
let cursor = ctx.to_typst_pos(self.position, &source)? + 1;
let ast_node = LinkedNode::new(source.root()).leaf_at_compat(cursor)?;
let CursorClass::Arg {
let SyntaxContext::Arg {
callee,
target,
is_set,
..
} = classify_cursor(ast_node, Some(cursor))?
} = classify_context(ast_node, Some(cursor))?
else {
return None;
};