File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -745,7 +745,15 @@ mod tests {
745745
746746 #[ test]
747747 fn test_loading_rust_analyzer ( ) {
748- let path = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . parent ( ) . unwrap ( ) . parent ( ) . unwrap ( ) ;
748+ let cargo_toml_path = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) )
749+ . parent ( )
750+ . unwrap ( )
751+ . parent ( )
752+ . unwrap ( )
753+ . join ( "Cargo.toml" ) ;
754+ let cargo_toml_path = AbsPathBuf :: assert_utf8 ( cargo_toml_path) ;
755+ let manifest = ProjectManifest :: from_manifest_file ( cargo_toml_path) . unwrap ( ) ;
756+
749757 let cargo_config = CargoConfig { set_test : true , ..CargoConfig :: default ( ) } ;
750758 let load_cargo_config = LoadCargoConfig {
751759 load_out_dirs_from_check : false ,
@@ -754,8 +762,9 @@ mod tests {
754762 num_worker_threads : 1 ,
755763 proc_macro_processes : 1 ,
756764 } ;
765+ let workspace = ProjectWorkspace :: load ( manifest, & cargo_config, & |_| { } ) . unwrap ( ) ;
757766 let ( db, _vfs, _proc_macro) =
758- load_workspace_at ( path , & cargo_config, & load_cargo_config, & |_| { } ) . unwrap ( ) ;
767+ load_workspace ( workspace , & cargo_config. extra_env , & load_cargo_config) . unwrap ( ) ;
759768
760769 let n_crates = db. all_crates ( ) . len ( ) ;
761770 // RA has quite a few crates, but the exact count doesn't matter
You can’t perform that action at this time.
0 commit comments