Conversation
shulaoda
force-pushed
the
08-20-feat_support_ignored_path_filtering
branch
from
August 20, 2026 14:02
ae876ea to
45864c3
Compare
shulaoda
force-pushed
the
08-20-feat_support_ignored_path_filtering
branch
from
September 21, 2026 02:10
66dee0c to
c086f52
Compare
shulaoda
added a commit
that referenced
this pull request
Sep 29, 2026
This is a reworked version of #114. ## Why A watcher cannot skip paths. Watching a project also watches `node_modules` and `.git`, which costs many watch resources and reports events nobody needs. chokidar solves this with `ignored`. ## Changes Adds `Config::with_ignored(|path, kind| ...)`. An ignored path is treated as if it did not exist: - It is never watched, scanned or reported. `watch()` and `unwatch()` of it return `Ok(())` and do nothing. - inotify, kqueue and poll do not descend into ignored directories. FSEvents and Windows watch recursively in the kernel, so they drop the events of ignored paths instead. - The filter is asked once per path, never about its parents. To ignore a directory with everything inside it, it must return `true` for every path below it. - `kind` is `Dir`, `File`, or `Unknown` when the watcher cannot tell (a missing path, every event on Windows). - `notify-debouncer-full` gives the filter to its `FileIdCache` and does not add an ignored path as a root. - FSEvents restarts its stream only when a watch was really added or removed, because a restart drops events. ## Breaking change `Config` (and debouncer-mini's `Config`) no longer derive `Copy`, `PartialEq`, `Eq` and `Hash`, because the filter is an `Arc<dyn Fn>`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.