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

Unified Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1181603004: Add AnalysisContext.onResultComputed(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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: 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 3452582b55b1f323f94ea0340c57eb65fa7aa99b..79035fba33a1edfaeda2e283f12f52faf08d1cb9 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -1015,6 +1015,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
+ Stream<ResultComputedEvent> onResultComputed(ResultDescriptor descriptor) {
+ return driver.onResultComputed(descriptor);
+ }
+
+ @override
CompilationUnit parseCompilationUnit(Source source) {
if (!AnalysisEngine.isDartFileName(source.shortName)) {
return null;
@@ -1109,7 +1114,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED);
entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED);
entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED);
- entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED);
+ entry.setState(RESOLVED_UNIT_NO_CONSTANTS, CacheState.FLUSHED);
// USED_IMPORTED_ELEMENTS
// USED_LOCAL_ELEMENTS
setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS);
@@ -1914,36 +1919,6 @@ class PendingFuture<T> {
}
/**
- * [ResultComputedEvent] describes a value computed for a [ResultDescriptor].
- */
-class ResultComputedEvent<V> {
- /**
- * The context in which the value was computed.
- */
- final AnalysisContext context;
-
- /**
- * The descriptor of the result which was computed.
- */
- final ResultDescriptor<V> descriptor;
-
- /**
- * The target for which the result was computed.
- */
- final AnalysisTarget target;
-
- /**
- * The computed value.
- */
- final V value;
-
- ResultComputedEvent(this.context, this.descriptor, this.target, this.value);
-
- @override
- String toString() => '$value for $descriptor of $target in $context';
-}
-
-/**
* An [AnalysisContext] that only contains sources for a Dart SDK.
*/
class SdkAnalysisContext extends AnalysisContextImpl {

Powered by Google App Engine
This is Rietveld 408576698