File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
src/tools/rust-analyzer/crates Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,11 @@ impl ProjectFolders {
265265 entries. push ( manifest. to_owned ( ) ) ;
266266 }
267267
268+ for buildfile in ws. buildfiles ( ) {
269+ file_set_roots. push ( VfsPath :: from ( buildfile. to_owned ( ) ) ) ;
270+ entries. push ( buildfile. to_owned ( ) ) ;
271+ }
272+
268273 // In case of detached files we do **not** look for a rust-analyzer.toml.
269274 if !matches ! ( ws. kind, ProjectWorkspaceKind :: DetachedFile { .. } ) {
270275 let ws_root = ws. workspace_root ( ) ;
Original file line number Diff line number Diff line change @@ -539,6 +539,17 @@ impl ProjectWorkspace {
539539 }
540540 }
541541
542+ pub fn buildfiles ( & self ) -> Vec < AbsPathBuf > {
543+ match & self . kind {
544+ ProjectWorkspaceKind :: Json ( project) => project
545+ . crates ( )
546+ . filter_map ( |( _, krate) | krate. build . as_ref ( ) . map ( |build| build. build_file . clone ( ) ) )
547+ . map ( AbsPathBuf :: assert)
548+ . collect ( ) ,
549+ _ => vec ! [ ] ,
550+ }
551+ }
552+
542553 pub fn find_sysroot_proc_macro_srv ( & self ) -> anyhow:: Result < AbsPathBuf > {
543554 self . sysroot . discover_proc_macro_srv ( )
544555 }
You can’t perform that action at this time.
0 commit comments