Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(891)

Unified Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 2959903005: Issue 29968. When a file is added, and it is already known, refresh it. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/driver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/driver.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index da2436d23b5d0b430474827a8d6d7a3ae07b7245..f95375865fe3d4f43fd4ba3321b9de0adb4ad9c4 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -480,6 +480,13 @@ class AnalysisDriver implements AnalysisDriverGeneric {
}
if (AnalysisEngine.isDartFileName(path)) {
_fileTracker.addFile(path);
+ // If the file is known, it has already been read, even if it did not
+ // exist. Now we are notified that the file exists, so we need to
+ // re-read it and make sure that we invalidate signature of the files
+ // that reference it.
+ if (_fsState.knownFilePaths.contains(path)) {
+ _changeFile(path);
+ }
}
}
@@ -503,8 +510,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
*/
void changeFile(String path) {
_throwIfChangesAreNotAllowed();
- _fileTracker.changeFile(path);
- _priorityResults.clear();
+ _changeFile(path);
}
/**
@@ -947,6 +953,14 @@ class AnalysisDriver implements AnalysisDriverGeneric {
}
/**
+ * Implementation for [changeFile].
+ */
+ void _changeFile(String path) {
+ _fileTracker.changeFile(path);
+ _priorityResults.clear();
+ }
+
+ /**
* Handles a notification from the [FileTracker] that there has been a change
* of state.
*/
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698