mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 21:13:37 +00:00
Include buildfiles in vfs
This commit is contained in:
parent
af9a658864
commit
85ca217765
2 changed files with 16 additions and 0 deletions
|
@ -265,6 +265,11 @@ impl ProjectFolders {
|
|||
entries.push(manifest.to_owned());
|
||||
}
|
||||
|
||||
for buildfile in ws.buildfiles() {
|
||||
file_set_roots.push(VfsPath::from(buildfile.to_owned()));
|
||||
entries.push(buildfile.to_owned());
|
||||
}
|
||||
|
||||
// In case of detached files we do **not** look for a rust-analyzer.toml.
|
||||
if !matches!(ws.kind, ProjectWorkspaceKind::DetachedFile { .. }) {
|
||||
let ws_root = ws.workspace_root();
|
||||
|
|
|
@ -539,6 +539,17 @@ impl ProjectWorkspace {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn buildfiles(&self) -> Vec<AbsPathBuf> {
|
||||
match &self.kind {
|
||||
ProjectWorkspaceKind::Json(project) => project
|
||||
.crates()
|
||||
.filter_map(|(_, krate)| krate.build.as_ref().map(|build| build.build_file.clone()))
|
||||
.map(AbsPathBuf::assert)
|
||||
.collect(),
|
||||
_ => vec![],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn find_sysroot_proc_macro_srv(&self) -> anyhow::Result<AbsPathBuf> {
|
||||
self.sysroot.discover_proc_macro_srv()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue