mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-01 07:48:45 +00:00
take into account excludeDirs when computing linked_projects
This commit is contained in:
parent
7009e5ab35
commit
1ee8fefcff
1 changed files with 16 additions and 1 deletions
|
@ -694,7 +694,22 @@ impl Config {
|
||||||
match self.data.linkedProjects.as_slice() {
|
match self.data.linkedProjects.as_slice() {
|
||||||
[] => match self.discovered_projects.as_ref() {
|
[] => match self.discovered_projects.as_ref() {
|
||||||
Some(discovered_projects) => {
|
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(),
|
None => Vec::new(),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue