Skip to content

Commit 1ee8fef

Browse files
committed
take into account excludeDirs when computing linked_projects
1 parent 7009e5a commit 1ee8fef

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,22 @@ impl Config {
694694
match self.data.linkedProjects.as_slice() {
695695
[] => match self.discovered_projects.as_ref() {
696696
Some(discovered_projects) => {
697-
discovered_projects.iter().cloned().map(LinkedProject::from).collect()
697+
let exclude_dirs: Vec<_> = self
698+
.data
699+
.files_excludeDirs
700+
.iter()
701+
.map(|p| self.root_path.join(p))
702+
.collect();
703+
discovered_projects
704+
.iter()
705+
.filter(|p| {
706+
let (ProjectManifest::ProjectJson(path)
707+
| ProjectManifest::CargoToml(path)) = p;
708+
!exclude_dirs.iter().any(|p| path.starts_with(p))
709+
})
710+
.cloned()
711+
.map(LinkedProject::from)
712+
.collect()
698713
}
699714
None => Vec::new(),
700715
},

0 commit comments

Comments
 (0)