Skip to content

package:watcher wrong events following case-ambiguous rename/delete on Windows and Mac #2271

@davidmorgan

Description

@davidmorgan

If you rename foo -> Foo it current emits modify for foo and add for Foo, it should emit remove for foo and add for Foo.

You can see the confusion in VSCode on Windows if you do renames on the command line

echo "error" > error.dart
mv error.dart Error.dart
mv error.dart other.dart
mv other.dart error.dart

After commands 1..3 you should see (in "focus on problems view") the analyzer reporting that there is an error in the source file, but after the last command it reports nothing: the analyzer thinks the file has disappeared.

That's because the watcher never picked up that error.dart was gone, so it did not emit an add for it on the last rename; the analyzer on the other hand did notice that error.dart was gone, so in the end it concludes there is no file there.

This is low priority for watcher use in the IDE, since people mostly don't mess with the case of files. Still, if the fix is not too complex/expensive it'd be nice to do it right, or if it's too hard at least document it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions