Skip to content

Commit 69906f5

Browse files
Merge pull request #473 from bm-w/bw/fix-default-file-path
Fix not defaulting to `Builder::file` for `FILE_PATH`.
2 parents 123350f + 3090222 commit 69906f5

File tree

1 file changed

+7
-0
lines changed
  • tree-sitter-stack-graphs/src

1 file changed

+7
-0
lines changed

tree-sitter-stack-graphs/src/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,13 @@ impl<'a> Builder<'a> {
653653
.add(JUMP_TO_SCOPE_NODE_VAR.into(), jump_to_scope_node.into())
654654
.expect("Failed to set JUMP_TO_SCOPE_NODE");
655655

656+
if globals.get(&FILE_PATH_VAR.into()).is_none() {
657+
let file_name = self.stack_graph[self.file].to_string();
658+
globals
659+
.add(FILE_PATH_VAR.into(), file_name.into())
660+
.expect("Failed to set FILE_PATH");
661+
}
662+
656663
let mut config = ExecutionConfig::new(&self.sgl.functions, &globals)
657664
.lazy(true)
658665
.debug_attributes(

0 commit comments

Comments
 (0)