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

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: Fixes for review comments. 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/test/generated/engine_test.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..02621a2cc06043e9f8bdd626bc379617090250db 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -520,6 +520,13 @@ abstract class AnalysisContext {
Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor);
/**
+ * Return the stream that is notified when a result with the given
+ * [descriptor] is invalidated.
+ */
+ Stream<InvalidatedResultEvent> 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.
@@ -1865,7 +1872,7 @@ class ComputedResult<V> {
ComputedResult(this.context, this.descriptor, this.target, this.value);
@override
- String toString() => '$descriptor of $target in $context';
+ String toString() => 'Computed $descriptor of $target in $context';
}
/**
@@ -2059,6 +2066,38 @@ abstract class InternalAnalysisContext implements AnalysisContext {
}
/**
+ * [InvalidatedResultEvent] describes an invalidated analysis result.
+ */
+class InvalidatedResultEvent<V> {
Brian Wilkerson 2016/03/08 18:36:36 Given that it's now identical to ComputedResult (e
+ /**
+ * The context in which the result was invalidated.
+ */
+ final AnalysisContext context;
+
+ /**
+ * The target for which the result was invalidated.
+ */
+ final AnalysisTarget target;
+
+ /**
+ * The descriptor of the result which was invalidated.
+ */
+ final ResultDescriptor<V> descriptor;
+
+ /**
+ * The value of the result before it was invalidated, may be the default
+ * value if the result was flushed.
+ */
+ final V value;
+
+ InvalidatedResultEvent(
+ this.context, this.target, this.descriptor, this.value);
+
+ @override
+ String toString() => 'Invalidated $descriptor of $target';
+}
+
+/**
* 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/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698