@@ -24,10 +24,10 @@ macro_rules! test_analysis {
2424 let mut files = FileStore :: new( ) ;
2525 let src = test_files:: fixture( $path) ;
2626 let id = files. add_file( $path, src) ;
27- let fe_module = match fe_parser:: parse_file( & src) {
27+ let fe_module = match fe_parser:: parse_file( id , & src) {
2828 Ok ( ( module, _) ) => module,
2929 Err ( diags) => {
30- print_diagnostics( & diags, id , & files) ;
30+ print_diagnostics( & diags, & files) ;
3131 panic!( "parsing failed" ) ;
3232 }
3333 } ;
@@ -36,7 +36,7 @@ macro_rules! test_analysis {
3636 let module = db. intern_module( Rc :: new( items:: Module { ast: fe_module } ) ) ;
3737 let diagnostics = module. diagnostics( & db) ;
3838 if !diagnostics. is_empty( ) {
39- print_diagnostics( & diagnostics, id , & files) ;
39+ print_diagnostics( & diagnostics, & files) ;
4040 panic!( "analysis failed" )
4141 }
4242
@@ -46,10 +46,10 @@ macro_rules! test_analysis {
4646 // for larger diffs. I recommend commenting out all tests but one.
4747 fe_common:: assert_snapshot_wasm!(
4848 concat!( "snapshots/analysis__" , stringify!( $name) , ".snap" ) ,
49- build_snapshot( $path , & src , module, & db)
49+ build_snapshot( files , module, & db)
5050 ) ;
5151 } else {
52- assert_snapshot!( build_snapshot( $path , & src , module, & db) ) ;
52+ assert_snapshot!( build_snapshot( files , module, & db) ) ;
5353 }
5454 }
5555 } ;
@@ -162,10 +162,7 @@ test_analysis! { data_copying_stress, "stress/data_copying_stress.fe"}
162162test_analysis ! { tuple_stress, "stress/tuple_stress.fe" }
163163test_analysis ! { type_aliases, "features/type_aliases.fe" }
164164
165- fn build_snapshot ( path : & str , src : & str , module : items:: ModuleId , db : & dyn AnalyzerDb ) -> String {
166- let mut file_store = FileStore :: new ( ) ;
167- let id = file_store. add_file ( path, src) ;
168-
165+ fn build_snapshot ( file_store : FileStore , module : items:: ModuleId , db : & dyn AnalyzerDb ) -> String {
169166 // contract and struct types aren't worth printing
170167 let type_aliases = module
171168 . all_items ( db)
@@ -286,7 +283,7 @@ fn build_snapshot(path: &str, src: &str, module: items::ModuleId, db: &dyn Analy
286283 ]
287284 . concat ( ) ;
288285
289- diagnostics_string ( & diagnostics, id , & file_store)
286+ diagnostics_string ( & diagnostics, & file_store)
290287}
291288
292289fn lookup_spans < T : Clone > (
0 commit comments