diff --git a/crates/fs/src/fs_watcher.rs b/crates/fs/src/fs_watcher.rs index 6db36992dece57d307b2b0a1f2a4c31c76c94cd5..f99d5d0b70eb775455397b44176eb26efe5c370e 100644 --- a/crates/fs/src/fs_watcher.rs +++ b/crates/fs/src/fs_watcher.rs @@ -1,4 +1,4 @@ -use notify::EventKind; +use notify::{Event, EventKind}; use parking_lot::Mutex; use std::{ collections::{BTreeMap, HashMap}, @@ -458,6 +458,16 @@ fn handle_poll_event(event: Result) { } fn handle_event(mode: WatcherMode, event: Result) { + if matches!( + event, + Ok(Event { + kind: EventKind::Access(_), + .. + }) + ) { + return; + } + log::trace!("global handle event for {mode:?}: {event:?}"); let callbacks = { @@ -472,9 +482,6 @@ fn handle_event(mode: WatcherMode, event: Result) match event { Ok(event) => { - if matches!(event.kind, EventKind::Access(_)) { - return; - } for callback in callbacks { callback(Ok(&event)); }