From 0b89a81c91647f1f1be475cf026eb7241528d2d0 Mon Sep 17 00:00:00 2001 From: Aditya-PS-05 Date: Sat, 22 Nov 2025 19:30:31 +0530 Subject: [PATCH 1/2] fix: Include all target types with paths outside package root --- crates/project-model/src/workspace.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/project-model/src/workspace.rs b/crates/project-model/src/workspace.rs index 4d56668cf28c..79bbbfb235e5 100644 --- a/crates/project-model/src/workspace.rs +++ b/crates/project-model/src/workspace.rs @@ -819,10 +819,16 @@ impl ProjectWorkspace { // [lib] // path = "../../src/lib.rs" // ``` + // + // or + // + // ```toml + // [[bin]] + // path = "../bin_folder/main.rs" + // ``` let extra_targets = cargo[pkg] .targets .iter() - .filter(|&&tgt| matches!(cargo[tgt].kind, TargetKind::Lib { .. })) .filter_map(|&tgt| cargo[tgt].root.parent()) .map(|tgt| tgt.normalize().to_path_buf()) .filter(|path| !path.starts_with(&pkg_root)); @@ -874,10 +880,16 @@ impl ProjectWorkspace { // [lib] // path = "../../src/lib.rs" // ``` + // + // or + // + // ```toml + // [[bin]] + // path = "../bin_folder/main.rs" + // ``` let extra_targets = cargo[pkg] .targets .iter() - .filter(|&&tgt| matches!(cargo[tgt].kind, TargetKind::Lib { .. })) .filter_map(|&tgt| cargo[tgt].root.parent()) .map(|tgt| tgt.normalize().to_path_buf()) .filter(|path| !path.starts_with(&pkg_root)); From 85fcca685f5f581c8abf8573405ebb27ec28a22b Mon Sep 17 00:00:00 2001 From: Aditya-PS-05 Date: Sun, 23 Nov 2025 20:45:57 +0530 Subject: [PATCH 2/2] fix: sort and dedup include paths to prevent VFS issues --- crates/project-model/src/workspace.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/project-model/src/workspace.rs b/crates/project-model/src/workspace.rs index 79bbbfb235e5..e02891eca205 100644 --- a/crates/project-model/src/workspace.rs +++ b/crates/project-model/src/workspace.rs @@ -844,6 +844,8 @@ impl ProjectWorkspace { exclude.push(pkg_root.join("examples")); exclude.push(pkg_root.join("benches")); } + include.sort(); + include.dedup(); PackageRoot { is_local, include, exclude } }) .chain(mk_sysroot()) @@ -905,6 +907,8 @@ impl ProjectWorkspace { exclude.push(pkg_root.join("examples")); exclude.push(pkg_root.join("benches")); } + include.sort(); + include.dedup(); PackageRoot { is_local, include, exclude } }) }))