fs: Replace MacWatcher with notify::FsEventWatcher (#47322)
Closes #47064
Closes #20806
The previous implementation used Zed's custom fsevent crate, which
spawned a dedicated thread for each watched path. On large projects,
this could result in 100+ threads just for filesystem watching.
This PR removes the `fsevent` crate and switches to using `notify's`
FsEventWatcher directly. The notify implementation maintains a single
FSEvents stream that watches all paths on one thread. When paths are
added or removed, the stream is stopped, the path list is updated, and
the stream is restarted.
Ref: https://github.com/notify-rs/notify/blob/main/notify/src/fsevent.rs
As a result, Zed now uses one thread for filesystem watching regardless
of how many paths are watched.
Release Notes:
- On macOS, Zed now uses significantly fewer resources when watching
filesystem changes
---------
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
b1f9ca96ecMarco Mihai Condrache committed on 1/27/2026, 7:12:41 PM· committed by GitHubparent4ffe748