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

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

Issue 1448173002: Add ApplyChangesStatus to AnalysisContext.applyChanges() and use it in DAS. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 9eaeecc6913eacf3b4c1c4ae4365d0008b82c74d..63ee777366c809d340cc4bc66beadb12b98af21c 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -452,7 +452,7 @@ abstract class AnalysisContext {
* analysis results that have been invalidated by these changes will be
* removed.
*/
- void applyChanges(ChangeSet changeSet);
+ ApplyChangesStatus applyChanges(ChangeSet changeSet);
/**
* Return the documentation comment for the given [element] as it appears in
@@ -1616,9 +1616,9 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
- void applyChanges(ChangeSet changeSet) {
+ ApplyChangesStatus applyChanges(ChangeSet changeSet) {
if (changeSet.isEmpty) {
- return;
+ return new ApplyChangesStatus(false);
}
//
// First, compute the list of sources that have been removed.
@@ -1658,6 +1658,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
_sourceRemoved(source);
}
_onSourcesChangedController.add(new SourcesChangedEvent(changeSet));
+ return new ApplyChangesStatus(true);
}
@override
@@ -6802,6 +6803,18 @@ abstract class AnalysisTaskVisitor<E> {
}
/**
+ * The result of applying a [ChangeSet] to a [AnalysisContext].
+ */
+class ApplyChangesStatus {
+ /**
+ * Is `true` if the given [ChangeSet] caused any changes in the context.
+ */
+ final bool hasChanges;
+
+ ApplyChangesStatus(this.hasChanges);
+}
+
+/**
* A `CachedResult` is a single analysis result that is stored in a
* [SourceEntry].
*/

Powered by Google App Engine
This is Rietveld 408576698