-
Notifications
You must be signed in to change notification settings - Fork 73
Add package-private extension type Event on FileSystemEvent. #2200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR HealthBreaking changes ✔️
This check can be disabled by tagging the PR with Coverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with |
0093e22
to
fae3f0c
Compare
The SDK FileSystemEvent type is confusing in how it handles isDirectory: for the FileSystemDeleteEvent subclass it always returns false, even if you explicitly pass true to the constructor. Some watcher code is currently passing true to the constructor as if it will do something.
So while it initially looks like there are eight types of event (create file, create directory, modify file, modify directory, remove file, remove directory, move file, move directory) there are actually only seven.
Create an extension type around FileSystemEvent that makes this clear: use an event type enum with seven entries instead of four entries + a boolean, so as not to have to deal with the impossible/unrepresentable "delete directory".
Use it just for the file watcher and Linux directory watcher in this PR as these are the simplest. Follow-on PRs will update Mac and Windows directory watchers which are a lot more fun :)
No behavior changes.
Test failures on MacOS on dev SDK are unrelated, they are due to an SDK issue dart-lang/sdk#61693