Skip to content

Commit

Permalink
take into account excludeDirs when computing linked_projects
Browse files Browse the repository at this point in the history
  • Loading branch information
vemoo committed May 21, 2022
1 parent 7009e5a commit 1ee8fef
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,22 @@ impl Config {
match self.data.linkedProjects.as_slice() {
[] => match self.discovered_projects.as_ref() {
Some(discovered_projects) => {
discovered_projects.iter().cloned().map(LinkedProject::from).collect()
let exclude_dirs: Vec<_> = self
.data
.files_excludeDirs
.iter()
.map(|p| self.root_path.join(p))
.collect();
discovered_projects
.iter()
.filter(|p| {
let (ProjectManifest::ProjectJson(path)
| ProjectManifest::CargoToml(path)) = p;
!exclude_dirs.iter().any(|p| path.starts_with(p))
})
.cloned()
.map(LinkedProject::from)
.collect()
}
None => Vec::new(),
},
Expand Down

0 comments on commit 1ee8fef

Please sign in to comment.