This repository was archived by the owner on Sep 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed
tree-sitter-stack-graphs/src Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -356,14 +356,7 @@ impl<'a> Indexer<'a> {
356356 tsg_str : & lc. sgl . tsg_source ( ) ,
357357 } ) ?;
358358 }
359- for lc in lcs. secondary {
360- let fa = match source_path
361- . file_name ( )
362- . and_then ( |file_name| lc. special_files . get ( & file_name. to_string_lossy ( ) ) )
363- {
364- Some ( fa) => fa,
365- None => panic ! ( "secondary language missing analyzer" ) ,
366- } ;
359+ for ( _, fa) in lcs. secondary {
367360 fa. build_stack_graph_into (
368361 graph,
369362 file,
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ impl TestArgs {
211211 . load_for_file ( & load_path, & mut file_reader, cancellation_flag) ?
212212 . primary
213213 {
214- Some ( sgl ) => sgl ,
214+ Some ( lc ) => lc ,
215215 None => return Ok ( TestResult :: new ( ) ) ,
216216 } ;
217217
Original file line number Diff line number Diff line change @@ -348,7 +348,10 @@ pub struct FileLanguageConfigurations<'a> {
348348 /// The file's primary language. The language configuration's `StackGraphLanguage` should be used to process the file.
349349 pub primary : Option < & ' a LanguageConfiguration > ,
350350 /// Any secondary languages, which have special file analyzers for the file.
351- pub secondary : Vec < & ' a LanguageConfiguration > ,
351+ pub secondary : Vec < (
352+ & ' a LanguageConfiguration ,
353+ Arc < dyn FileAnalyzer + Send + Sync > ,
354+ ) > ,
352355}
353356
354357impl FileLanguageConfigurations < ' _ > {
@@ -470,12 +473,11 @@ impl LanguageConfigurationsLoader {
470473 let primary = LanguageConfiguration :: best_for_file ( & self . configurations , path, content) ?;
471474 let mut secondary = Vec :: new ( ) ;
472475 for language in self . configurations . iter ( ) {
473- if path
476+ if let Some ( fa ) = path
474477 . file_name ( )
475478 . and_then ( |file_name| language. special_files . get ( & file_name. to_string_lossy ( ) ) )
476- . is_some ( )
477479 {
478- secondary. push ( language) ;
480+ secondary. push ( ( language, fa ) ) ;
479481 }
480482 }
481483 Ok ( FileLanguageConfigurations { primary, secondary } )
You can’t perform that action at this time.
0 commit comments