diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2025-01-16 09:18:48 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-16 09:18:48 +0000 |
| commit | 419bdb20e2b3c9e133e23133a10bb3bec1b2b7b7 (patch) | |
| tree | 78ec4c8055e0f565efe4f0cc04a200054b6862b4 | |
| parent | 8ec90940f2f7ce45f2371a3b1af6cb25417eb3bb (diff) | |
| parent | c00dfedc3429fd667372b1dbf22cb3d6daa5b857 (diff) | |
| download | rust-419bdb20e2b3c9e133e23133a10bb3bec1b2b7b7.tar.gz rust-419bdb20e2b3c9e133e23133a10bb3bec1b2b7b7.zip | |
Merge pull request #18949 from Veykril/push-yzklntsnnuts
Partially back out "fix: Fix sourceroot construction for virtual manifests"
| -rw-r--r-- | src/tools/rust-analyzer/crates/load-cargo/src/lib.rs | 5 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/project-model/src/workspace.rs | 13 |
2 files changed, 5 insertions, 13 deletions
diff --git a/src/tools/rust-analyzer/crates/load-cargo/src/lib.rs b/src/tools/rust-analyzer/crates/load-cargo/src/lib.rs index 73899408652..00446b27cf2 100644 --- a/src/tools/rust-analyzer/crates/load-cargo/src/lib.rs +++ b/src/tools/rust-analyzer/crates/load-cargo/src/lib.rs @@ -242,9 +242,6 @@ impl ProjectFolders { } } - if dirs.include.is_empty() { - continue; - } vfs::loader::Entry::Directories(dirs) }; @@ -267,7 +264,7 @@ impl ProjectFolders { }; let file_set_roots = vec![VfsPath::from(ratoml_path.to_owned())]; - let entry = vfs::loader::Entry::Files(vec![ratoml_path]); + let entry = vfs::loader::Entry::Files(vec![ratoml_path.to_owned()]); res.watch.push(res.load.len()); res.load.push(entry); diff --git a/src/tools/rust-analyzer/crates/project-model/src/workspace.rs b/src/tools/rust-analyzer/crates/project-model/src/workspace.rs index 465a1ad0ec5..f98d983ac06 100644 --- a/src/tools/rust-analyzer/crates/project-model/src/workspace.rs +++ b/src/tools/rust-analyzer/crates/project-model/src/workspace.rs @@ -11,9 +11,8 @@ use base_db::{ }; use cfg::{CfgAtom, CfgDiff, CfgOptions}; use intern::{sym, Symbol}; -use itertools::Itertools; use paths::{AbsPath, AbsPathBuf}; -use rustc_hash::FxHashMap; +use rustc_hash::{FxHashMap, FxHashSet}; use semver::Version; use span::{Edition, FileId}; use tracing::instrument; @@ -591,9 +590,10 @@ impl ProjectWorkspace { exclude: krate.exclude.clone(), } }) + .collect::<FxHashSet<_>>() + .into_iter() .chain(mk_sysroot()) - .unique() - .collect(), + .collect::<Vec<_>>(), ProjectWorkspaceKind::Cargo { cargo, rustc, build_scripts, error: _, set_test: _ } => { cargo .packages() @@ -643,11 +643,6 @@ impl ProjectWorkspace { exclude: Vec::new(), }) })) - .chain(cargo.is_virtual_workspace().then(|| PackageRoot { - is_local: true, - include: vec![cargo.workspace_root().to_path_buf()], - exclude: Vec::new(), - })) .collect() } ProjectWorkspaceKind::DetachedFile { file, cargo: cargo_script, .. } => { |
