| 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/task/model.dart'; | 13 import 'package:analyzer/task/model.dart'; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * The analysis errors associated with a target. | 16 * The analysis errors associated with a target. |
| 17 * | 17 * |
| 18 * The value combines errors represented by multiple other results. | 18 * The value combines errors represented by multiple other results. |
| 19 */ | 19 */ |
| 20 // TODO(brianwilkerson) If we want to associate errors with targets smaller than | 20 // 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 | 21 // 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. | 22 // we might want to rename this and/or document that it applies to files. |
| 23 final CompositeResultDescriptor<List<AnalysisError>> DART_ERRORS = | 23 final CompositeResultDescriptor<List<AnalysisError>> DART_ERRORS = |
| 24 new CompositeResultDescriptor<List<AnalysisError>>('DART_ERRORS'); | 24 new CompositeResultDescriptor<List<AnalysisError>>('DART_ERRORS'); |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * The sources of the libraries that are explicitly imported into a library. |
| 28 * |
| 29 * The list will be empty if there are no explicit imports, but will not be |
| 30 * `null`. |
| 31 * |
| 32 * The result is only available for targets representing a Dart library. |
| 33 */ |
| 34 final ListResultDescriptor<Source> EXPLICITLY_IMPORTED_LIBRARIES = |
| 35 new ListResultDescriptor<Source>('EXPLICITLY_IMPORTED_LIBRARIES', Source.EMP
TY_ARRAY); |
| 36 |
| 37 /** |
| 27 * The sources of the libraries that are exported from a library. | 38 * The sources of the libraries that are exported from a library. |
| 28 * | 39 * |
| 29 * The list will be empty if there are no exported libraries, but will not be | 40 * The list will be empty if there are no exported libraries, but will not be |
| 30 * `null`. | 41 * `null`. |
| 31 * | 42 * |
| 32 * The result is only available for targets representing a Dart library. | 43 * The result is only available for targets representing a Dart library. |
| 33 */ | 44 */ |
| 34 final ListResultDescriptor<Source> EXPORTED_LIBRARIES = | 45 final ListResultDescriptor<Source> EXPORTED_LIBRARIES = |
| 35 new ListResultDescriptor<Source>('EXPORTED_LIBRARIES', Source.EMPTY_ARRAY); | 46 new ListResultDescriptor<Source>('EXPORTED_LIBRARIES', Source.EMPTY_ARRAY); |
| 36 | 47 |
| 37 /** | 48 /** |
| 38 * The sources of the libraries that are imported into a library. | 49 * The sources of the libraries that are implicitly or explicitly imported into |
| 50 * a library. |
| 39 * | 51 * |
| 40 * Not `null`. | 52 * The list will minimally contain the source for `dart:core` because it is |
| 41 * The default value is empty. | 53 * implicitly imported into every library, and therefore will never be `null`. |
| 42 * When computed, this list will always contain at least `dart:core` source. | |
| 43 * | 54 * |
| 44 * The result is only available for targets representing a Dart library. | 55 * The result is only available for targets representing a Dart library. |
| 45 */ | 56 */ |
| 46 final ListResultDescriptor<Source> IMPORTED_LIBRARIES = | 57 final ListResultDescriptor<Source> IMPORTED_LIBRARIES = |
| 47 new ListResultDescriptor<Source>('IMPORTED_LIBRARIES', Source.EMPTY_ARRAY); | 58 new ListResultDescriptor<Source>('IMPORTED_LIBRARIES', Source.EMPTY_ARRAY); |
| 48 | 59 |
| 49 /** | 60 /** |
| 50 * The sources of the parts that are included in a library. | 61 * The sources of the parts that are included in a library. |
| 51 * | 62 * |
| 52 * The list will be empty if there are no parts, but will not be `null`. The | 63 * The list will be empty if there are no parts, but will not be `null`. The |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 @override | 169 @override |
| 159 bool operator ==(other) { | 170 bool operator ==(other) { |
| 160 return other is LibrarySpecificUnit && | 171 return other is LibrarySpecificUnit && |
| 161 other.library == library && | 172 other.library == library && |
| 162 other.unit == unit; | 173 other.unit == unit; |
| 163 } | 174 } |
| 164 | 175 |
| 165 @override | 176 @override |
| 166 String toString() => '$unit in $library'; | 177 String toString() => '$unit in $library'; |
| 167 } | 178 } |
| OLD | NEW |