diff options
Diffstat (limited to 'crates/ra_vfs/src/lib.rs')
-rw-r--r-- | crates/ra_vfs/src/lib.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ra_vfs/src/lib.rs b/crates/ra_vfs/src/lib.rs index f4447be43..4f3896a82 100644 --- a/crates/ra_vfs/src/lib.rs +++ b/crates/ra_vfs/src/lib.rs | |||
@@ -59,7 +59,15 @@ impl RootFilter { | |||
59 | 59 | ||
60 | pub(crate) fn default_filter(path: &Path, rel_path: &RelativePath) -> bool { | 60 | pub(crate) fn default_filter(path: &Path, rel_path: &RelativePath) -> bool { |
61 | if path.is_dir() { | 61 | if path.is_dir() { |
62 | rel_path.components().next() != Some(Component::Normal("target")) | 62 | for (i, c) in rel_path.components().enumerate() { |
63 | if let Component::Normal(c) = c { | ||
64 | // hardcoded for now | ||
65 | if (i == 0 && c == "target") || c == ".git" || c == "node_modules" { | ||
66 | return false; | ||
67 | } | ||
68 | } | ||
69 | } | ||
70 | true | ||
63 | } else { | 71 | } else { |
64 | rel_path.extension() == Some("rs") | 72 | rel_path.extension() == Some("rs") |
65 | } | 73 | } |