diff options
author | Bernardo <[email protected]> | 2019-01-21 17:37:46 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-26 08:46:27 +0000 |
commit | 7f7c4e7465f58cdbfdaaf232d571960f1b754b7c (patch) | |
tree | c45ced6a30832a53e2485744751ddd810663107c /crates/ra_vfs/src/watcher.rs | |
parent | f88355ccb5e8ea2381e13eabcdb64880e757aff1 (diff) |
do not emit create for directory again
Diffstat (limited to 'crates/ra_vfs/src/watcher.rs')
-rw-r--r-- | crates/ra_vfs/src/watcher.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_vfs/src/watcher.rs b/crates/ra_vfs/src/watcher.rs index d8c35f2a3..606935891 100644 --- a/crates/ra_vfs/src/watcher.rs +++ b/crates/ra_vfs/src/watcher.rs | |||
@@ -87,7 +87,7 @@ impl Watcher { | |||
87 | &mut self, | 87 | &mut self, |
88 | dir: &Path, | 88 | dir: &Path, |
89 | filter_entry: impl Fn(&DirEntry) -> bool, | 89 | filter_entry: impl Fn(&DirEntry) -> bool, |
90 | emit_for_existing: bool, | 90 | emit_for_contents: bool, |
91 | ) { | 91 | ) { |
92 | for res in WalkDir::new(dir).into_iter().filter_entry(filter_entry) { | 92 | for res in WalkDir::new(dir).into_iter().filter_entry(filter_entry) { |
93 | match res { | 93 | match res { |
@@ -98,7 +98,7 @@ impl Watcher { | |||
98 | Err(e) => log::warn!("could not watch \"{}\": {}", dir.display(), e), | 98 | Err(e) => log::warn!("could not watch \"{}\": {}", dir.display(), e), |
99 | } | 99 | } |
100 | } | 100 | } |
101 | if emit_for_existing { | 101 | if emit_for_contents && entry.depth() > 0 { |
102 | // emit as create because we haven't seen it yet | 102 | // emit as create because we haven't seen it yet |
103 | if let Err(e) = | 103 | if let Err(e) = |
104 | self.sender | 104 | self.sender |