Skip to content

Commit 419bdb2

Browse files
authored
Merge pull request #18949 from Veykril/push-yzklntsnnuts
Partially back out "fix: Fix sourceroot construction for virtual manifests"
2 parents 8ec9094 + c00dfed commit 419bdb2

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/tools/rust-analyzer/crates/load-cargo/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@ impl ProjectFolders {
242242
}
243243
}
244244

245-
if dirs.include.is_empty() {
246-
continue;
247-
}
248245
vfs::loader::Entry::Directories(dirs)
249246
};
250247

@@ -267,7 +264,7 @@ impl ProjectFolders {
267264
};
268265

269266
let file_set_roots = vec![VfsPath::from(ratoml_path.to_owned())];
270-
let entry = vfs::loader::Entry::Files(vec![ratoml_path]);
267+
let entry = vfs::loader::Entry::Files(vec![ratoml_path.to_owned()]);
271268

272269
res.watch.push(res.load.len());
273270
res.load.push(entry);

src/tools/rust-analyzer/crates/project-model/src/workspace.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ use base_db::{
1111
};
1212
use cfg::{CfgAtom, CfgDiff, CfgOptions};
1313
use intern::{sym, Symbol};
14-
use itertools::Itertools;
1514
use paths::{AbsPath, AbsPathBuf};
16-
use rustc_hash::FxHashMap;
15+
use rustc_hash::{FxHashMap, FxHashSet};
1716
use semver::Version;
1817
use span::{Edition, FileId};
1918
use tracing::instrument;
@@ -591,9 +590,10 @@ impl ProjectWorkspace {
591590
exclude: krate.exclude.clone(),
592591
}
593592
})
593+
.collect::<FxHashSet<_>>()
594+
.into_iter()
594595
.chain(mk_sysroot())
595-
.unique()
596-
.collect(),
596+
.collect::<Vec<_>>(),
597597
ProjectWorkspaceKind::Cargo { cargo, rustc, build_scripts, error: _, set_test: _ } => {
598598
cargo
599599
.packages()
@@ -643,11 +643,6 @@ impl ProjectWorkspace {
643643
exclude: Vec::new(),
644644
})
645645
}))
646-
.chain(cargo.is_virtual_workspace().then(|| PackageRoot {
647-
is_local: true,
648-
include: vec![cargo.workspace_root().to_path_buf()],
649-
exclude: Vec::new(),
650-
}))
651646
.collect()
652647
}
653648
ProjectWorkspaceKind::DetachedFile { file, cargo: cargo_script, .. } => {

0 commit comments

Comments
 (0)