feat: incorporated with static function signature analysis (#688)

* feat: finished function signature analysis

* dev: update snapshot

* dev: broken snapshot
This commit is contained in:
Myriad-Dreamin 2024-10-16 15:53:43 +08:00 committed by GitHub
parent a3f100e7cb
commit 02bbdbf8d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 429 additions and 270 deletions

View file

@ -3,7 +3,7 @@ use typst_shim::syntax::LinkedNodeExt;
use crate::{
adt::interner::Interned,
analysis::{analyze_dyn_signature, find_definition},
analysis::find_definition,
prelude::*,
syntax::{get_check_target, get_deref_target, CheckTarget, ParamTarget},
DocTooltip, LspParamInfo, SemanticRequest,
@ -62,7 +62,7 @@ impl SemanticRequest for SignatureHelpRequest {
function = &inner.0;
}
let sig = analyze_dyn_signature(ctx, function.clone());
let sig = ctx.signature_dyn(function.clone());
let pos = sig.primary().pos();
let named = sig.primary().named();
let rest = sig.primary().rest();
@ -91,7 +91,7 @@ impl SemanticRequest for SignatureHelpRequest {
let mut real_offset = 0;
let focus_name = OnceCell::new();
for (i, (param, ty)) in pos.chain(named).chain(rest).enumerate() {
if is_set && !param.settable {
if is_set && !param.attrs.settable {
continue;
}