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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java

Issue 341533005: Change contract for ChangeSet to reflect AnalysisContext behavior. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
index e715c4912415346ab46f0061b484dcd039d7fde7..69a39d8f325587d107dbef8c0a863dfb282e0db4 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
@@ -1017,6 +1017,11 @@ public class AnalysisContextImpl implements InternalAnalysisContext {
}
}
for (Source source : changeSet.getChangedSources()) {
+ if (contentCache.getContents(source) != null) {
+ // This source is overridden in the content cache, so the change will have no effect.
+ // Just ignore it to avoid wasting time doing re-analysis.
+ continue;
+ }
sourceChanged(source);
}
for (Map.Entry<Source, String> entry : changeSet.getChangedContents().entrySet()) {
@@ -4070,27 +4075,29 @@ public class AnalysisContextImpl implements InternalAnalysisContext {
return;
}
}
- CacheState verificationErrorsState = dartEntry.getStateInLibrary(
- DartEntry.VERIFICATION_ERRORS,
- librarySource);
- if (verificationErrorsState == CacheState.INVALID
- || (isPriority && verificationErrorsState == CacheState.FLUSHED)) {
- LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
- if (libraryElement != null) {
- sources.add(source);
- return;
- }
- }
- if (hintsEnabled) {
- CacheState hintsState = dartEntry.getStateInLibrary(DartEntry.HINTS, librarySource);
- if (hintsState == CacheState.INVALID
- || (isPriority && hintsState == CacheState.FLUSHED)) {
+ if (generateSdkErrors || !source.isInSystemLibrary()) {
+ CacheState verificationErrorsState = dartEntry.getStateInLibrary(
+ DartEntry.VERIFICATION_ERRORS,
+ librarySource);
+ if (verificationErrorsState == CacheState.INVALID
+ || (isPriority && verificationErrorsState == CacheState.FLUSHED)) {
LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
if (libraryElement != null) {
sources.add(source);
return;
}
}
+ if (hintsEnabled) {
+ CacheState hintsState = dartEntry.getStateInLibrary(DartEntry.HINTS, librarySource);
+ if (hintsState == CacheState.INVALID
+ || (isPriority && hintsState == CacheState.FLUSHED)) {
+ LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
+ if (libraryElement != null) {
+ sources.add(source);
+ return;
+ }
+ }
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698