mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
Don't exclude dirs that appear in project root parent path
This commit is contained in:
parent
fb971c3bce
commit
f2f3c554af
1 changed files with 7 additions and 9 deletions
|
@ -180,13 +180,11 @@ impl TidyDocs {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool {
|
fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool {
|
||||||
let mut cur_path = p;
|
p.strip_prefix(project_root())
|
||||||
while let Some(path) = cur_path.parent() {
|
.unwrap()
|
||||||
if dirs_to_exclude.iter().any(|dir| path.ends_with(dir)) {
|
.components()
|
||||||
return true;
|
.rev()
|
||||||
}
|
.skip(1)
|
||||||
cur_path = path;
|
.filter_map(|it| it.as_os_str().to_str())
|
||||||
}
|
.any(|it| dirs_to_exclude.contains(&it))
|
||||||
|
|
||||||
false
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue