From eeed6cf53b9f6112329cc8a274dcf63bce887c50 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Mon, 21 Jan 2019 21:48:07 +0100 Subject: [PATCH] fix recursive watch --- crates/ra_vfs/src/io/watcher.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/ra_vfs/src/io/watcher.rs b/crates/ra_vfs/src/io/watcher.rs index 5e9bc8ff3f7..b370c5fbcd1 100644 --- a/crates/ra_vfs/src/io/watcher.rs +++ b/crates/ra_vfs/src/io/watcher.rs @@ -91,9 +91,14 @@ pub fn watch_recursive(&mut self, dir: &Path, filter: &RootFilter, emit_for_cont match res { Ok(entry) => { if entry.path().is_dir() { - match self.watcher.watch(dir, RecursiveMode::NonRecursive) { - Ok(()) => log::debug!("watching \"{}\"", dir.display()), - Err(e) => log::warn!("could not watch \"{}\": {}", dir.display(), e), + match self + .watcher + .watch(entry.path(), RecursiveMode::NonRecursive) + { + Ok(()) => log::debug!("watching \"{}\"", entry.path().display()), + Err(e) => { + log::warn!("could not watch \"{}\": {}", entry.path().display(), e) + } } } if emit_for_contents && entry.depth() > 0 {