OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.task.dart; | 5 library analyzer.task.dart; |
6 | 6 |
7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
9 import 'package:analyzer/src/generated/error.dart'; | 9 import 'package:analyzer/src/generated/error.dart'; |
10 import 'package:analyzer/src/generated/scanner.dart'; | 10 import 'package:analyzer/src/generated/scanner.dart'; |
11 import 'package:analyzer/src/generated/source.dart'; | 11 import 'package:analyzer/src/generated/source.dart'; |
12 import 'package:analyzer/src/generated/utilities_general.dart'; | 12 import 'package:analyzer/src/generated/utilities_general.dart'; |
| 13 import 'package:analyzer/src/task/dart.dart'; |
13 import 'package:analyzer/task/model.dart'; | 14 import 'package:analyzer/task/model.dart'; |
14 | 15 |
15 /** | 16 /** |
16 * The analysis errors associated with a target. | 17 * The analysis errors associated with a target. |
17 * | 18 * |
18 * The value combines errors represented by multiple other results. | 19 * The value combines errors represented by multiple other results. |
19 */ | 20 */ |
20 // TODO(brianwilkerson) If we want to associate errors with targets smaller than | 21 // TODO(brianwilkerson) If we want to associate errors with targets smaller than |
21 // a file, we will need other contribution points to collect them. In which case | 22 // a file, we will need other contribution points to collect them. In which case |
22 // we might want to rename this and/or document that it applies to files. | 23 // we might want to rename this and/or document that it applies to files. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 new ResultDescriptor<LibraryElement>('LIBRARY_ELEMENT', null); | 96 new ResultDescriptor<LibraryElement>('LIBRARY_ELEMENT', null); |
96 | 97 |
97 /** | 98 /** |
98 * The compilation unit AST produced while parsing a compilation unit. | 99 * The compilation unit AST produced while parsing a compilation unit. |
99 * | 100 * |
100 * The AST structure will not have resolution information associated with it. | 101 * The AST structure will not have resolution information associated with it. |
101 * | 102 * |
102 * The result is only available for targets representing a Dart compilation unit
. | 103 * The result is only available for targets representing a Dart compilation unit
. |
103 */ | 104 */ |
104 final ResultDescriptor<CompilationUnit> PARSED_UNIT = | 105 final ResultDescriptor<CompilationUnit> PARSED_UNIT = |
105 new ResultDescriptor<CompilationUnit>('PARSED_UNIT', null); | 106 new ResultDescriptor<CompilationUnit>('PARSED_UNIT', null, |
| 107 cachingPolicy: AST_CACHING_POLICY); |
106 | 108 |
107 /** | 109 /** |
108 * The resolved [CompilationUnit] associated with a unit. | 110 * The resolved [CompilationUnit] associated with a unit. |
109 * | 111 * |
110 * The result is only available for targets representing a unit. | 112 * The result is only available for targets representing a unit. |
111 */ | 113 */ |
112 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT = | 114 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT = |
113 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT', null); | 115 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT', null, |
| 116 cachingPolicy: AST_CACHING_POLICY); |
114 | 117 |
115 /** | 118 /** |
116 * The token stream produced while scanning a compilation unit. | 119 * The token stream produced while scanning a compilation unit. |
117 * | 120 * |
118 * The value is the first token in the file, or the special end-of-file marker | 121 * The value is the first token in the file, or the special end-of-file marker |
119 * at the end of the stream if the file does not contain any tokens. | 122 * at the end of the stream if the file does not contain any tokens. |
120 * | 123 * |
121 * The result is only available for targets representing a Dart compilation unit
. | 124 * The result is only available for targets representing a Dart compilation unit
. |
122 */ | 125 */ |
123 final ResultDescriptor<Token> TOKEN_STREAM = | 126 final ResultDescriptor<Token> TOKEN_STREAM = new ResultDescriptor<Token>( |
124 new ResultDescriptor<Token>('TOKEN_STREAM', null); | 127 'TOKEN_STREAM', null, cachingPolicy: TOKEN_STREAM_CACHING_POLICY); |
125 | 128 |
126 /** | 129 /** |
127 * The sources of the Dart files that a library consists of. | 130 * The sources of the Dart files that a library consists of. |
128 * | 131 * |
129 * The list will include the source of the defining unit and [INCLUDED_PARTS]. | 132 * The list will include the source of the defining unit and [INCLUDED_PARTS]. |
130 * So, it is never empty or `null`. | 133 * So, it is never empty or `null`. |
131 * | 134 * |
132 * The result is only available for targets representing a Dart library. | 135 * The result is only available for targets representing a Dart library. |
133 */ | 136 */ |
134 final ListResultDescriptor<Source> UNITS = | 137 final ListResultDescriptor<Source> UNITS = |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 @override | 173 @override |
171 bool operator ==(other) { | 174 bool operator ==(other) { |
172 return other is LibrarySpecificUnit && | 175 return other is LibrarySpecificUnit && |
173 other.library == library && | 176 other.library == library && |
174 other.unit == unit; | 177 other.unit == unit; |
175 } | 178 } |
176 | 179 |
177 @override | 180 @override |
178 String toString() => '$unit in $library'; | 181 String toString() => '$unit in $library'; |
179 } | 182 } |
OLD | NEW |