diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-25 17:40:57 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-25 17:40:57 +0100 |
commit | 3b10f9e714925640f96478f3c033614e2ccdfd45 (patch) | |
tree | 46110dcb85e9975dc24f133200d161e3c0c5e526 | |
parent | 3a1369955800752ed3a24f52ed2eb6be7ddf22a4 (diff) | |
parent | 96ee19851b18c10049c0951445a4087f7d069fbb (diff) |
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 <[email protected]>
-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 7a53e4a8b..93b5ff55f 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -455,7 +455,11 @@ impl ProjectFolders { | |||
455 | dirs.include.extend(root.include); | 455 | dirs.include.extend(root.include); |
456 | dirs.exclude.extend(root.exclude); | 456 | dirs.exclude.extend(root.exclude); |
457 | for excl in global_excludes { | 457 | for excl in global_excludes { |
458 | if dirs.include.iter().any(|incl| incl.starts_with(excl)) { | 458 | if dirs |
459 | .include | ||
460 | .iter() | ||
461 | .any(|incl| incl.starts_with(excl) || excl.starts_with(incl)) | ||
462 | { | ||
459 | dirs.exclude.push(excl.clone()); | 463 | dirs.exclude.push(excl.clone()); |
460 | } | 464 | } |
461 | } | 465 | } |