From 96ee19851b18c10049c0951445a4087f7d069fbb Mon Sep 17 00:00:00 2001 From: ammkrn Date: Tue, 25 May 2021 10:07:01 -0500 Subject: Check for subdirs in vfs loader exclusions. 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. --- crates/rust-analyzer/src/reload.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { 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()); } } -- cgit v1.2.3