diff options
author | Bernardo <[email protected]> | 2019-01-22 17:14:31 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-26 08:46:27 +0000 |
commit | 0a086508524bed87bb15113437e9c2b1e1be4c42 (patch) | |
tree | 73420a38d4a1d3eafd5e823dc5b1f8d92c6311b4 /crates/ra_vfs/src/lib.rs | |
parent | 10a24cf649b4e136bb4f25cd295c2fb15125d71a (diff) |
hardcode ".git" and "node_modules" also
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 | } |