File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
src/tools/rust-analyzer/crates/project-model/src Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -606,18 +606,18 @@ impl ProjectWorkspace {
606606 ProjectWorkspaceKind :: Json ( project) => project
607607 . crates ( )
608608 . map ( |( _, krate) | {
609- let build_files = project
610- . crates ( )
611- . filter_map ( | ( _ , krate ) | {
612- krate . build . as_ref ( ) . map ( |build| build . build_file . clone ( ) )
613- } )
614- // FIXME: PackageRoots dont allow specifying files, only directories
615- . filter_map ( |build_file| {
616- self . workspace_root ( ) . join ( build_file ) . parent ( ) . map ( ToOwned :: to_owned)
617- } ) ;
609+ // FIXME: PackageRoots dont allow specifying files, only directories
610+ let build_file = krate
611+ . build
612+ . as_ref ( )
613+ . map ( |build| self . workspace_root ( ) . join ( & build . build_file ) )
614+ . as_deref ( )
615+ . and_then ( AbsPath :: parent )
616+ . map ( ToOwned :: to_owned) ;
617+
618618 PackageRoot {
619619 is_local : krate. is_workspace_member ,
620- include : krate. include . iter ( ) . cloned ( ) . chain ( build_files ) . collect ( ) ,
620+ include : krate. include . iter ( ) . cloned ( ) . chain ( build_file ) . collect ( ) ,
621621 exclude : krate. exclude . clone ( ) ,
622622 }
623623 } )
You can’t perform that action at this time.
0 commit comments