mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-19 18:55:01 +00:00
fix: don't panic on bad node range
This commit is contained in:
parent
4abde9de2e
commit
964def25a9
13 changed files with 51 additions and 92 deletions
|
@ -13,8 +13,7 @@ impl SignatureHelpRequest {
|
|||
position_encoding: PositionEncoding,
|
||||
) -> Option<SignatureHelp> {
|
||||
let source = get_suitable_source_in_workspace(world, &self.path).ok()?;
|
||||
let typst_offset =
|
||||
lsp_to_typst::position_to_offset(self.position, position_encoding, &source);
|
||||
let typst_offset = lsp_to_typst::position(self.position, position_encoding, &source)?;
|
||||
|
||||
let ast_node = LinkedNode::new(source.root()).leaf_at(typst_offset)?;
|
||||
let (callee, callee_node, args) = surrounding_function_syntax(&ast_node)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue