mirror of
https://github.com/typst/typst
synced 2025-06-01 17:56:24 +08:00
Fix tracing of most field call expressions (#6234)
This commit is contained in:
parent
9bbfa5ae05
commit
9ac21b8524
@ -37,7 +37,12 @@ impl Eval for ast::FuncCall<'_> {
|
||||
let target = access.target();
|
||||
let field = access.field();
|
||||
match eval_field_call(target, field, args, span, vm)? {
|
||||
FieldCall::Normal(callee, args) => (callee, args),
|
||||
FieldCall::Normal(callee, args) => {
|
||||
if vm.inspected == Some(callee_span) {
|
||||
vm.trace(callee.clone());
|
||||
}
|
||||
(callee, args)
|
||||
}
|
||||
FieldCall::Resolved(value) => return Ok(value),
|
||||
}
|
||||
} else {
|
||||
|
@ -371,4 +371,11 @@ mod tests {
|
||||
test(&world, -2, Side::Before).must_be_none();
|
||||
test(&world, -2, Side::After).must_be_text("This star imports `a`, `b`, and `c`");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tooltip_field_call() {
|
||||
let world = TestWorld::new("#import \"other.typ\"\n#other.f()")
|
||||
.with_source("other.typ", "#let f = (x) => 1");
|
||||
test(&world, -4, Side::After).must_be_code("(..) => ..");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user