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

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

Issue 1776023002: Add AnalysisContext.onResultInvalidated(descriptor). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/dart_work_manager.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 57d35d91212d749e4133189ddc1390cfaf43d1d1..2518b4f2fe36e1aa7912809de48ce48602cde3e1 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -520,6 +520,12 @@ abstract class AnalysisContext {
Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor);
/**
+ * Return the stream that is notified when a result with the given
+ * [descriptor] is invalidated.
+ */
+ Stream<InvalidatedResult> onResultInvalidated(ResultDescriptor descriptor);
+
+ /**
* Parse the content of the given [source] to produce an AST structure. The
* resulting AST structure may or may not be resolved, and may have a slightly
* different structure depending upon whether it is resolved.
@@ -2059,6 +2065,31 @@ abstract class InternalAnalysisContext implements AnalysisContext {
}
/**
+ * [InvalidatedResult] describes an invalidated result.
+ */
+class InvalidatedResult<V> {
Brian Wilkerson 2016/03/08 17:54:31 Maybe rename to InvalidatedResultEvent?
scheglov 2016/03/08 18:24:44 Done.
+ /**
+ * The target in which the result was invalidated.
+ */
+ final CacheEntry entry;
Brian Wilkerson 2016/03/08 17:54:31 I really don't want CacheEntry to be part of the p
scheglov 2016/03/08 18:24:45 I changed the set of fields to be like in Computed
+
+ /**
+ * The descriptor of the result which was invalidated.
+ */
+ final ResultDescriptor<V> descriptor;
+
+ /**
+ * The value of the result which was invalidated.
Brian Wilkerson 2016/03/08 17:54:31 "which was" --> "before it was"?
scheglov 2016/03/08 18:24:44 Done.
+ */
+ final V value;
+
+ InvalidatedResult(this.entry, this.descriptor, this.value);
+
+ @override
+ String toString() => '$descriptor of ${entry.target}';
Brian Wilkerson 2016/03/08 17:54:31 "'$d" --> "'Invalidated $d"? Otherwise it's too cl
scheglov 2016/03/08 18:24:44 Done.
+}
+
+/**
* An object that can be used to receive information about errors within the
* analysis engine. Implementations usually write this information to a file,
* but can also record the information for later use (such as during testing) or
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/dart_work_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698