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

Unified Diff: pkg/analyzer/lib/src/context/context.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/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 5f6c81727402400d62a48ca35a0fd4c2a23ce69e..70871f9bbb7ebdc55fa428cf9db3bad75577d9f4 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -955,7 +955,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
bool changed = newContents != originalContents;
if (newContents != null) {
- if (newContents != originalContents) {
+ if (changed) {
if (!analysisOptions.incremental ||
!_tryPoorMansIncrementalResolution(source, newContents)) {
_sourceChanged(source);
@@ -966,7 +966,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
entry.modificationTime = _contentCache.getModificationStamp(source);
}
} else if (originalContents != null) {
- 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 {
@@ -977,11 +976,15 @@ class AnalysisContextImpl implements InternalAnalysisContext {
entry.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) {
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | pkg/analyzer/test/generated/engine_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698