a8b48d3e2c
It caused race condition via async nature of DAS and AnalysisDriver. My understanding of the scenario: 1. We started fulling AD with files. 2. We set `priorityFiles`, this notifies the scheduler. 3. We add Dart files to AD. 4. We do something async, this allows the scheduler to ask AD to takes the next file, and start analyzing it. 5. We run transitionToAnalyzingToIdleIfNoFilesToAnalyze(), it sees there there are no files _to_ analyze (the only file is _being_ analyzed). So, it turns analysis on/off. 6. DAS sends "analysis: done", `dart analyze` says, I'm done, no errors. 7. AD ends analysis of the file, report errors. Too late. I believe we don't need this (hackish) method anymore. 1. We switch to analysis status with `priorityFiles`, for good or bad. 2. We are more aggressive now to switch status on/off. Bug: https://github.com/flutter/flutter/issues/141873 Change-Id: If4e8b74ebdce33b173a686a7b87d14368dfc175d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347421 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>