aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_vfs/src/io
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_vfs/src/io')
-rw-r--r--crates/ra_vfs/src/io/watcher.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/crates/ra_vfs/src/io/watcher.rs b/crates/ra_vfs/src/io/watcher.rs
index b370c5fbc..68bb6b692 100644
--- a/crates/ra_vfs/src/io/watcher.rs
+++ b/crates/ra_vfs/src/io/watcher.rs
@@ -100,16 +100,18 @@ impl Watcher {
100 log::warn!("could not watch \"{}\": {}", entry.path().display(), e) 100 log::warn!("could not watch \"{}\": {}", entry.path().display(), e)
101 } 101 }
102 } 102 }
103 } 103 } else {
104 if emit_for_contents && entry.depth() > 0 { 104 if emit_for_contents && entry.depth() > 0 {
105 // emit as create because we haven't seen it yet 105 // emit only for files otherwise we will cause watch_recursive to be called again with a dir that we are already watching
106 if let Err(e) = 106 // emit as create because we haven't seen it yet
107 self.sender 107 if let Err(e) =
108 .send(io::Task::HandleChange(WatcherChange::Create( 108 self.sender
109 entry.path().to_path_buf(), 109 .send(io::Task::HandleChange(WatcherChange::Create(
110 ))) 110 entry.path().to_path_buf(),
111 { 111 )))
112 log::warn!("watcher error: {}", e) 112 {
113 log::warn!("watcher error: {}", e)
114 }
113 } 115 }
114 } 116 }
115 } 117 }