diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-25 16:40:57 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-25 16:40:57 +0000 |
| commit | 3b10f9e714925640f96478f3c033614e2ccdfd45 (patch) | |
| tree | 46110dcb85e9975dc24f133200d161e3c0c5e526 | |
| parent | 3a1369955800752ed3a24f52ed2eb6be7ddf22a4 (diff) | |
| parent | 96ee19851b18c10049c0951445a4087f7d069fbb (diff) | |
| download | rust-3b10f9e714925640f96478f3c033614e2ccdfd45.tar.gz rust-3b10f9e714925640f96478f3c033614e2ccdfd45.zip | |
Merge #8994
8994: Check for subdirs in vfs loader exclusions. r=matklad a=ammkrn The current logic used to transfer global_excludes into vfs exclusions only transfers global_excludes that are the parent of an item in dirs.include. This commit additionally adds an item from global_exclude to the vfs exclusions if the global_exclude is a child of an included item. Co-authored-by: ammkrn <ammkrn@tuta.io>
| -rw-r--r-- | crates/rust-analyzer/src/reload.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index 7a53e4a8b95..93b5ff55f7c 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs @@ -455,7 +455,11 @@ impl ProjectFolders { dirs.include.extend(root.include); dirs.exclude.extend(root.exclude); for excl in global_excludes { - if dirs.include.iter().any(|incl| incl.starts_with(excl)) { + if dirs + .include + .iter() + .any(|incl| incl.starts_with(excl) || excl.starts_with(incl)) + { dirs.exclude.push(excl.clone()); } } |
