OLD | NEW |
---|---|
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 Loading... | |
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<InvalidatedResultEvent> onResultInvalidated( | |
527 ResultDescriptor descriptor); | |
528 | |
529 /** | |
523 * Parse the content of the given [source] to produce an AST structure. The | 530 * 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 | 531 * resulting AST structure may or may not be resolved, and may have a slightly |
525 * different structure depending upon whether it is resolved. | 532 * different structure depending upon whether it is resolved. |
526 * | 533 * |
527 * Throws an [AnalysisException] if the analysis could not be performed | 534 * Throws an [AnalysisException] if the analysis could not be performed |
528 * | 535 * |
529 * <b>Note:</b> This method cannot be used in an async environment. | 536 * <b>Note:</b> This method cannot be used in an async environment. |
530 */ | 537 */ |
531 CompilationUnit parseCompilationUnit(Source source); | 538 CompilationUnit parseCompilationUnit(Source source); |
532 | 539 |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1858 final AnalysisTarget target; | 1865 final AnalysisTarget target; |
1859 | 1866 |
1860 /** | 1867 /** |
1861 * The computed value. | 1868 * The computed value. |
1862 */ | 1869 */ |
1863 final V value; | 1870 final V value; |
1864 | 1871 |
1865 ComputedResult(this.context, this.descriptor, this.target, this.value); | 1872 ComputedResult(this.context, this.descriptor, this.target, this.value); |
1866 | 1873 |
1867 @override | 1874 @override |
1868 String toString() => '$descriptor of $target in $context'; | 1875 String toString() => 'Computed $descriptor of $target in $context'; |
1869 } | 1876 } |
1870 | 1877 |
1871 /** | 1878 /** |
1872 * An event indicating when a source either starts or stops being implicitly | 1879 * An event indicating when a source either starts or stops being implicitly |
1873 * analyzed. | 1880 * analyzed. |
1874 */ | 1881 */ |
1875 class ImplicitAnalysisEvent { | 1882 class ImplicitAnalysisEvent { |
1876 /** | 1883 /** |
1877 * The source whose status has changed. | 1884 * The source whose status has changed. |
1878 */ | 1885 */ |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2052 */ | 2059 */ |
2053 void test_flushAstStructures(Source source); | 2060 void test_flushAstStructures(Source source); |
2054 | 2061 |
2055 /** | 2062 /** |
2056 * Visit all entries of the content cache. | 2063 * Visit all entries of the content cache. |
2057 */ | 2064 */ |
2058 void visitContentCache(ContentCacheVisitor visitor); | 2065 void visitContentCache(ContentCacheVisitor visitor); |
2059 } | 2066 } |
2060 | 2067 |
2061 /** | 2068 /** |
2069 * [InvalidatedResultEvent] describes an invalidated analysis result. | |
2070 */ | |
2071 class InvalidatedResultEvent<V> { | |
Brian Wilkerson
2016/03/08 18:36:36
Given that it's now identical to ComputedResult (e
| |
2072 /** | |
2073 * The context in which the result was invalidated. | |
2074 */ | |
2075 final AnalysisContext context; | |
2076 | |
2077 /** | |
2078 * The target for which the result was invalidated. | |
2079 */ | |
2080 final AnalysisTarget target; | |
2081 | |
2082 /** | |
2083 * The descriptor of the result which was invalidated. | |
2084 */ | |
2085 final ResultDescriptor<V> descriptor; | |
2086 | |
2087 /** | |
2088 * The value of the result before it was invalidated, may be the default | |
2089 * value if the result was flushed. | |
2090 */ | |
2091 final V value; | |
2092 | |
2093 InvalidatedResultEvent( | |
2094 this.context, this.target, this.descriptor, this.value); | |
2095 | |
2096 @override | |
2097 String toString() => 'Invalidated $descriptor of $target'; | |
2098 } | |
2099 | |
2100 /** | |
2062 * An object that can be used to receive information about errors within the | 2101 * An object that can be used to receive information about errors within the |
2063 * analysis engine. Implementations usually write this information to a file, | 2102 * 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 | 2103 * but can also record the information for later use (such as during testing) or |
2065 * even ignore the information. | 2104 * even ignore the information. |
2066 */ | 2105 */ |
2067 abstract class Logger { | 2106 abstract class Logger { |
2068 /** | 2107 /** |
2069 * A logger that ignores all logging. | 2108 * A logger that ignores all logging. |
2070 */ | 2109 */ |
2071 static final Logger NULL = new NullLogger(); | 2110 static final Logger NULL = new NullLogger(); |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2479 * The data that was created from the source. | 2518 * The data that was created from the source. |
2480 */ | 2519 */ |
2481 final E data; | 2520 final E data; |
2482 | 2521 |
2483 /** | 2522 /** |
2484 * Initialize a newly created holder to associate the given [data] with the | 2523 * Initialize a newly created holder to associate the given [data] with the |
2485 * given [modificationTime]. | 2524 * given [modificationTime]. |
2486 */ | 2525 */ |
2487 TimestampedData(this.modificationTime, this.data); | 2526 TimestampedData(this.modificationTime, this.data); |
2488 } | 2527 } |
OLD | NEW |