refactor: add compatibility for typst_syntax::LinkedNode.leaf_at (#582)

* refactor: add compatibility for `typst_syntax::LinkedNode.leaf_at`

* feat: `LinkedNodeExt` trait with `leaf_at_compat`
This commit is contained in:
ParaN3xus 2024-09-08 22:10:01 +08:00 committed by GitHub
parent ffa12bc2c9
commit ce107efc7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 86 additions and 28 deletions

View file

@ -1,4 +1,5 @@
use once_cell::sync::OnceCell;
use typst_shim::syntax::LinkedNodeExt;
use crate::{
adt::interner::Interned,
@ -27,7 +28,7 @@ impl SemanticRequest for SignatureHelpRequest {
let source = ctx.source_by_path(&self.path).ok()?;
let cursor = ctx.to_typst_pos(self.position, &source)? + 1;
let ast_node = LinkedNode::new(source.root()).leaf_at(cursor)?;
let ast_node = LinkedNode::new(source.root()).leaf_at_compat(cursor)?;
let CheckTarget::Param {
callee,
target,