Skip to content

Commit e1e1d4b

Browse files
committed
fix: make import trace line not show absolute path
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
1 parent cf772cc commit e1e1d4b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

crates/jrsonnet-evaluator/src/evaluate/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,15 +649,15 @@ pub fn evaluate(s: State, ctx: Context, expr: &LocExpr) -> Result<Val> {
649649
p
650650
})
651651
.unwrap_or_default();
652-
let path = s.resolve_file(&import_location, path as &str)?;
652+
let resolved_path = s.resolve_file(&import_location, path as &str)?;
653653
match i {
654654
Import(_) => s.push(
655655
CallLocation::new(loc),
656656
|| format!("import {:?}", path.clone()),
657-
|| s.import(path.clone()),
657+
|| s.import(resolved_path.clone()),
658658
)?,
659-
ImportStr(_) => Val::Str(s.import_str(path)?),
660-
ImportBin(_) => Val::Arr(ArrValue::Bytes(s.import_bin(path)?)),
659+
ImportStr(_) => Val::Str(s.import_str(resolved_path)?),
660+
ImportBin(_) => Val::Arr(ArrValue::Bytes(s.import_bin(resolved_path)?)),
661661
_ => unreachable!(),
662662
}
663663
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
infinite recursion detected
2-
issue23.jsonnet:1:1-26: import "/home/lach/build/jrsonnet/crates/jrsonnet-evaluator/tests/golden/issue23.jsonnet"
2+
issue23.jsonnet:1:1-26: import "issue23.jsonnet"

0 commit comments

Comments
 (0)