Another work around for an invalidation issue.
I still don't know why it happens.
But there might be something else as well, as users complaining
about the server not responsive. And one suspect is this infinite
cycle that I added. I thought it is safe, but something is wrong,
and it could be it.
Change-Id: I6095e1493c4cc49e6a5540bf30d244747c36641c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221023
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 8061657..a58388c 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -774,14 +774,8 @@
// We use affected files to remove library elements, and we can only get
// these library elements when we link or load them, using library cycles.
// And we get library cycles by asking `directReferencedFiles`.
- while (true) {
- final knownFiles = this.knownFiles.toList();
- for (var file in knownFiles.toList()) {
- file.directReferencedFiles;
- }
- if (this.knownFiles.length == knownFiles.length) {
- break;
- }
+ for (var file in knownFiles.toList()) {
+ file.directReferencedFiles;
}
collectAffected(FileState file) {