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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 1218573003: Try to use incremental resolution after removing overlays. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 68b16f864bba7e16157cad02f8a92c00789e7a07..e520eb507dde92315b986207ee43ad5e8109dbec 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -2170,7 +2170,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
bool changed = newContents != originalContents;
if (newContents != null) {
- if (newContents != originalContents) {
+ if (changed) {
_incrementalAnalysisCache =
IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
if (!analysisOptions.incremental ||
@@ -2187,7 +2187,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
} else if (originalContents != null) {
_incrementalAnalysisCache =
IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
- changed = newContents != originalContents;
// We are removing the overlay for the file, check if the file's
// contents is the same as it was in the overlay.
try {
@@ -2198,11 +2197,15 @@ class AnalysisContextImpl implements InternalAnalysisContext {
sourceEntry.modificationTime = fileContents.modificationTime;
changed = false;
}
+ newContents = fileContentsData;
} catch (e) {}
// If not the same content (e.g. the file is being closed without save),
// then force analysis.
if (changed) {
- _sourceChanged(source);
+ if (!analysisOptions.incremental ||
+ !_tryPoorMansIncrementalResolution(source, newContents)) {
+ _sourceChanged(source);
+ }
}
}
if (notify && changed) {

Powered by Google App Engine
This is Rietveld 408576698