@@ -297,6 +297,7 @@ pub async fn compile_syntax_node(
297297 doc_node : parser:: SyntaxNode ,
298298 mut diagnostics : diagnostics:: BuildDiagnostics ,
299299 #[ allow( unused_mut) ] mut compiler_config : CompilerConfiguration ,
300+ resource_preloader : impl crate :: passes:: ResourcePreloader ,
300301) -> ( object_tree:: Document , diagnostics:: BuildDiagnostics , typeloader:: TypeLoader ) {
301302 let mut loader = prepare_for_compile ( & mut diagnostics, compiler_config) ;
302303
@@ -316,7 +317,8 @@ pub async fn compile_syntax_node(
316317 ) ;
317318
318319 if !diagnostics. has_errors ( ) {
319- passes:: run_passes ( & mut doc, & mut loader, false , & mut diagnostics) . await ;
320+ passes:: run_passes ( & mut doc, & mut loader, false , & mut diagnostics, resource_preloader)
321+ . await ;
320322 } else {
321323 // Don't run all the passes in case of errors because because some invariants are not met.
322324 passes:: run_import_passes ( & doc, & loader, & mut diagnostics) ;
@@ -335,11 +337,13 @@ pub async fn load_root_file(
335337 source_code : String ,
336338 mut diagnostics : diagnostics:: BuildDiagnostics ,
337339 #[ allow( unused_mut) ] mut compiler_config : CompilerConfiguration ,
340+ resource_preloader : impl passes:: ResourcePreloader ,
338341) -> ( std:: path:: PathBuf , diagnostics:: BuildDiagnostics , typeloader:: TypeLoader ) {
339342 let mut loader = prepare_for_compile ( & mut diagnostics, compiler_config) ;
340343
341- let ( path, _) =
342- loader. load_root_file ( path, source_path, source_code, false , & mut diagnostics) . await ;
344+ let ( path, _) = loader
345+ . load_root_file ( path, source_path, source_code, false , & mut diagnostics, resource_preloader)
346+ . await ;
343347
344348 ( path, diagnostics, loader)
345349}
@@ -356,6 +360,7 @@ pub async fn load_root_file_with_raw_type_loader(
356360 source_code : String ,
357361 mut diagnostics : diagnostics:: BuildDiagnostics ,
358362 #[ allow( unused_mut) ] mut compiler_config : CompilerConfiguration ,
363+ resource_preloader : impl passes:: ResourcePreloader ,
359364) -> (
360365 std:: path:: PathBuf ,
361366 diagnostics:: BuildDiagnostics ,
@@ -364,8 +369,9 @@ pub async fn load_root_file_with_raw_type_loader(
364369) {
365370 let mut loader = prepare_for_compile ( & mut diagnostics, compiler_config) ;
366371
367- let ( path, raw_type_loader) =
368- loader. load_root_file ( path, source_path, source_code, true , & mut diagnostics) . await ;
372+ let ( path, raw_type_loader) = loader
373+ . load_root_file ( path, source_path, source_code, true , & mut diagnostics, resource_preloader)
374+ . await ;
369375
370376 ( path, diagnostics, loader, raw_type_loader)
371377}
0 commit comments