aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_vfs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_vfs')
-rw-r--r--crates/ra_vfs/src/io.rs (renamed from crates/ra_vfs/src/io/mod.rs)2
-rw-r--r--crates/ra_vfs/src/lib.rs10
2 files changed, 10 insertions, 2 deletions
diff --git a/crates/ra_vfs/src/io/mod.rs b/crates/ra_vfs/src/io.rs
index daac6c6f2..3ab52ac3d 100644
--- a/crates/ra_vfs/src/io/mod.rs
+++ b/crates/ra_vfs/src/io.rs
@@ -132,7 +132,7 @@ fn handle_task(task: Task, watcher: &Arc<Mutex<Option<Watcher>>>) -> TaskResult
132 root_filter, 132 root_filter,
133 nested_roots, 133 nested_roots,
134 } => { 134 } => {
135 watch(watcher, &path, &*root_filter, false); 135 watch(watcher, &path, root_filter.as_ref(), false);
136 log::debug!("loading {} ...", path.as_path().display()); 136 log::debug!("loading {} ...", path.as_path().display());
137 let files = load_root( 137 let files = load_root(
138 path.as_path(), 138 path.as_path(),
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
60pub(crate) fn default_filter(path: &Path, rel_path: &RelativePath) -> bool { 60pub(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 }