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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.engine; 5 library analyzer.src.generated.engine;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 */ 513 */
514 bool isServerLibrary(Source librarySource); 514 bool isServerLibrary(Source librarySource);
515 515
516 /** 516 /**
517 * Return the stream that is notified when a new value for the given 517 * Return the stream that is notified when a new value for the given
518 * [descriptor] is computed. 518 * [descriptor] is computed.
519 */ 519 */
520 Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor); 520 Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor);
521 521
522 /** 522 /**
523 * Return the stream that is notified when a result with the given
524 * [descriptor] is invalidated.
525 */
526 Stream<InvalidatedResult> onResultInvalidated(ResultDescriptor descriptor);
527
528 /**
523 * Parse the content of the given [source] to produce an AST structure. The 529 * Parse the content of the given [source] to produce an AST structure. The
524 * resulting AST structure may or may not be resolved, and may have a slightly 530 * resulting AST structure may or may not be resolved, and may have a slightly
525 * different structure depending upon whether it is resolved. 531 * different structure depending upon whether it is resolved.
526 * 532 *
527 * Throws an [AnalysisException] if the analysis could not be performed 533 * Throws an [AnalysisException] if the analysis could not be performed
528 * 534 *
529 * <b>Note:</b> This method cannot be used in an async environment. 535 * <b>Note:</b> This method cannot be used in an async environment.
530 */ 536 */
531 CompilationUnit parseCompilationUnit(Source source); 537 CompilationUnit parseCompilationUnit(Source source);
532 538
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 */ 2058 */
2053 void test_flushAstStructures(Source source); 2059 void test_flushAstStructures(Source source);
2054 2060
2055 /** 2061 /**
2056 * Visit all entries of the content cache. 2062 * Visit all entries of the content cache.
2057 */ 2063 */
2058 void visitContentCache(ContentCacheVisitor visitor); 2064 void visitContentCache(ContentCacheVisitor visitor);
2059 } 2065 }
2060 2066
2061 /** 2067 /**
2068 * [InvalidatedResult] describes an invalidated result.
2069 */
2070 class InvalidatedResult<V> {
Brian Wilkerson 2016/03/08 17:54:31 Maybe rename to InvalidatedResultEvent?
scheglov 2016/03/08 18:24:44 Done.
2071 /**
2072 * The target in which the result was invalidated.
2073 */
2074 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
2075
2076 /**
2077 * The descriptor of the result which was invalidated.
2078 */
2079 final ResultDescriptor<V> descriptor;
2080
2081 /**
2082 * 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.
2083 */
2084 final V value;
2085
2086 InvalidatedResult(this.entry, this.descriptor, this.value);
2087
2088 @override
2089 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.
2090 }
2091
2092 /**
2062 * An object that can be used to receive information about errors within the 2093 * An object that can be used to receive information about errors within the
2063 * analysis engine. Implementations usually write this information to a file, 2094 * analysis engine. Implementations usually write this information to a file,
2064 * but can also record the information for later use (such as during testing) or 2095 * but can also record the information for later use (such as during testing) or
2065 * even ignore the information. 2096 * even ignore the information.
2066 */ 2097 */
2067 abstract class Logger { 2098 abstract class Logger {
2068 /** 2099 /**
2069 * A logger that ignores all logging. 2100 * A logger that ignores all logging.
2070 */ 2101 */
2071 static final Logger NULL = new NullLogger(); 2102 static final Logger NULL = new NullLogger();
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
2479 * The data that was created from the source. 2510 * The data that was created from the source.
2480 */ 2511 */
2481 final E data; 2512 final E data;
2482 2513
2483 /** 2514 /**
2484 * Initialize a newly created holder to associate the given [data] with the 2515 * Initialize a newly created holder to associate the given [data] with the
2485 * given [modificationTime]. 2516 * given [modificationTime].
2486 */ 2517 */
2487 TimestampedData(this.modificationTime, this.data); 2518 TimestampedData(this.modificationTime, this.data);
2488 } 2519 }
OLDNEW
« 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