Open
Description
STEPS TO REPRODUCE
- Run
flutter analyze --watch
in a big package, e.g. the flutter framework (https://github.com/flutter/flutter/tree/master/packages/flutter) - From a separate terminal, create an empty file in that package, e.g.
touch foo.dart
- Delete that file, e.g.
rm foo.dart
EXPECTED RESULTS
Step 1 should take a while. Steps 2 and 3 should each trigger a very fast reanalysis.
ACTUAL RESULTS
Step 1 takes a while. Step 2 triggers a fast analysis. Step 3 triggers a multi-second analysis.
CONTEXT
This impacts users of IDEs that create temporary files with .dart
extensions. For example, Emacs creates advisory lock files with names like .#animated_size_test.dart
when a file is edited and not saved. (Actually in the case of Emacs it's not even a file, it's a symlink to a non-existent file, but the effect on the analyzer is the same.) When a file is saved, reanalysis takes multiple seconds every time even though nothing has changed, because the editor deletes this temporary file with a .dart
extension.