Skip to content

Commit c5b372c

Browse files
committed
Address review comments.
1 parent 16c88c5 commit c5b372c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pkgs/watcher/lib/src/directory_watcher/windows.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class WindowsDirectoryWatcher extends ResubscribableWatcher
2121
String get directory => path;
2222

2323
WindowsDirectoryWatcher(String directory)
24-
: super(directory, () => _WindowsDirectoryWatcher(directory));
24+
: super(directory, () => _WindowsDirectoryWatcher(directory));
2525
}
2626

2727
class _EventBatcher {
@@ -169,9 +169,10 @@ class _WindowsDirectoryWatcher
169169
void _onBatch(List<FileSystemEvent> batch) {
170170
_sortEvents(batch).forEach((path, eventSet) {
171171
var canonicalEvent = _canonicalEvent(eventSet);
172-
var events = canonicalEvent == null
173-
? _eventsBasedOnFileSystem(path)
174-
: [canonicalEvent];
172+
var events =
173+
canonicalEvent == null
174+
? _eventsBasedOnFileSystem(path)
175+
: [canonicalEvent];
175176

176177
for (var event in events) {
177178
if (event is FileSystemCreateEvent) {
@@ -199,7 +200,10 @@ class _WindowsDirectoryWatcher
199200
subscription.onError((Object e, StackTrace stackTrace) {
200201
_listSubscriptions.remove(subscription);
201202
// "Path not found" can be caused by creating then quickly removing
202-
// a directory: continue without reporting an error.
203+
// a directory: continue without reporting an error. Nested files
204+
// that get removed during the `list` are already ignored by `list`
205+
// itself, so there are no other types of "path not found" that
206+
// might need different handling here.
203207
if (e is! PathNotFoundException) {
204208
_emitError(e, stackTrace);
205209
}

0 commit comments

Comments
 (0)