| 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) {
|
|
|