aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_vfs
diff options
context:
space:
mode:
authorBernardo <[email protected]>2019-01-22 17:14:31 +0000
committerAleksey Kladov <[email protected]>2019-01-26 08:46:27 +0000
commit0a086508524bed87bb15113437e9c2b1e1be4c42 (patch)
tree73420a38d4a1d3eafd5e823dc5b1f8d92c6311b4 /crates/ra_vfs
parent10a24cf649b4e136bb4f25cd295c2fb15125d71a (diff)
hardcode ".git" and "node_modules" also
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 }