Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit a8f70c6

Browse files
author
Hendrik van Antwerpen
committed
Add file path to file analyzer method
1 parent fa0de2d commit a8f70c6

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

languages/tree-sitter-stack-graphs-typescript/rust/tsconfig.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Please see the LICENSE-APACHE or LICENSE-MIT files in this distribution for license details.
66
// ------------------------------------------------------------------------------------------------
77

8+
use std::path::Path;
9+
810
use stack_graphs::arena::Handle;
911
use stack_graphs::graph::File;
1012
use stack_graphs::graph::StackGraph;
@@ -17,6 +19,7 @@ impl FileAnalyzer for TsConfigAnalyzer {
1719
&'a self,
1820
_stack_graph: &'a mut StackGraph,
1921
_file: Handle<File>,
22+
_path: &Path,
2023
_source: &'a str,
2124
_cancellation_flag: &'a dyn tree_sitter_stack_graphs::CancellationFlag,
2225
) -> Result<(), tree_sitter_stack_graphs::LoadError> {

tree-sitter-stack-graphs/src/cli/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ impl TestArgs {
217217
fa.build_stack_graph_into(
218218
&mut test.graph,
219219
test_fragment.file,
220+
&fragment_path,
220221
&test_fragment.source,
221222
&NoCancellation,
222223
)?;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ use stack_graphs::graph::StackGraph;
319319
use std::collections::HashMap;
320320
use std::collections::HashSet;
321321
use std::mem::transmute;
322+
use std::path::Path;
322323
use std::sync::atomic::AtomicUsize;
323324
use std::sync::atomic::Ordering;
324325
use thiserror::Error;
@@ -942,6 +943,7 @@ pub trait FileAnalyzer {
942943
&'a self,
943944
stack_graph: &'a mut StackGraph,
944945
file: Handle<File>,
946+
path: &Path,
945947
source: &'a str,
946948
cancellation_flag: &'a dyn CancellationFlag,
947949
) -> Result<(), LoadError>;

0 commit comments

Comments
 (0)