| 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.src.task.dart_work_manager; | 5 library analyzer.src.task.dart_work_manager; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart' | 10 import 'package:analyzer/src/generated/engine.dart' |
| 11 show | 11 show |
| 12 AnalysisEngine, | 12 AnalysisEngine, |
| 13 AnalysisErrorInfo, | 13 AnalysisErrorInfo, |
| 14 AnalysisErrorInfoImpl, | 14 AnalysisErrorInfoImpl, |
| 15 AnalysisOptions, | 15 AnalysisOptions, |
| 16 CacheState, | 16 CacheState, |
| 17 InternalAnalysisContext; | 17 InternalAnalysisContext; |
| 18 import 'package:analyzer/src/generated/error.dart'; | 18 import 'package:analyzer/src/generated/error.dart'; |
| 19 import 'package:analyzer/src/generated/source.dart'; | 19 import 'package:analyzer/src/generated/source.dart'; |
| 20 import 'package:analyzer/src/generated/utilities_collection.dart'; | 20 import 'package:analyzer/src/generated/utilities_collection.dart'; |
| 21 import 'package:analyzer/src/task/dart.dart'; | 21 import 'package:analyzer/src/task/dart.dart'; |
| 22 import 'package:analyzer/src/task/driver.dart'; | 22 import 'package:analyzer/src/task/html.dart'; |
| 23 import 'package:analyzer/task/dart.dart'; | 23 import 'package:analyzer/task/dart.dart'; |
| 24 import 'package:analyzer/task/model.dart'; | 24 import 'package:analyzer/task/model.dart'; |
| 25 import 'package:analyzer/src/task/html.dart'; | |
| 26 | 25 |
| 27 /** | 26 /** |
| 28 * The manager for Dart specific analysis. | 27 * The manager for Dart specific analysis. |
| 29 */ | 28 */ |
| 30 class DartWorkManager implements WorkManager { | 29 class DartWorkManager implements WorkManager { |
| 31 /** | 30 /** |
| 32 * The list of errors that are reported for raw Dart [Source]s. | 31 * The list of errors that are reported for raw Dart [Source]s. |
| 33 */ | 32 */ |
| 34 static final List<ResultDescriptor> _SOURCE_ERRORS = <ResultDescriptor>[ | 33 static final List<ResultDescriptor> _SOURCE_ERRORS = <ResultDescriptor>[ |
| 35 BUILD_DIRECTIVES_ERRORS, | 34 BUILD_DIRECTIVES_ERRORS, |
| 36 BUILD_LIBRARY_ERRORS, | 35 BUILD_LIBRARY_ERRORS, |
| 37 PARSE_ERRORS, | 36 PARSE_ERRORS, |
| 38 SCAN_ERRORS | 37 SCAN_ERRORS |
| 39 ]; | 38 ]; |
| 40 | 39 |
| 41 /** | 40 /** |
| 42 * The list of errors that are reported for raw Dart [LibrarySpecificUnit]s. | 41 * The list of errors that are reported for raw Dart [LibrarySpecificUnit]s. |
| 43 */ | 42 */ |
| 44 static final List<ResultDescriptor> _UNIT_ERRORS = <ResultDescriptor>[ | 43 static final List<ResultDescriptor> _UNIT_ERRORS = <ResultDescriptor>[ |
| 45 HINTS, | 44 HINTS, |
| 46 RESOLVE_REFERENCES_ERRORS, | 45 INFER_STATIC_VARIABLE_TYPES_ERRORS, |
| 46 LIBRARY_UNIT_ERRORS, |
| 47 PARTIALLY_RESOLVE_REFERENCES_ERRORS, |
| 48 RESOLVE_FUNCTION_BODIES_ERRORS, |
| 47 RESOLVE_TYPE_NAMES_ERRORS, | 49 RESOLVE_TYPE_NAMES_ERRORS, |
| 48 VARIABLE_REFERENCE_ERRORS, | 50 VARIABLE_REFERENCE_ERRORS, |
| 49 VERIFY_ERRORS | 51 VERIFY_ERRORS |
| 50 ]; | 52 ]; |
| 51 | 53 |
| 52 final InternalAnalysisContext context; | 54 final InternalAnalysisContext context; |
| 53 | 55 |
| 54 /** | 56 /** |
| 55 * The [TargetedResult]s that should be computed with priority. | 57 * The [TargetedResult]s that should be computed with priority. |
| 56 */ | 58 */ |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 } | 434 } |
| 433 } | 435 } |
| 434 | 436 |
| 435 bool _shouldErrorsBeComputed(Source source) => | 437 bool _shouldErrorsBeComputed(Source source) => |
| 436 context.shouldErrorsBeAnalyzed(source, null); | 438 context.shouldErrorsBeAnalyzed(source, null); |
| 437 | 439 |
| 438 static bool _isDartSource(AnalysisTarget target) { | 440 static bool _isDartSource(AnalysisTarget target) { |
| 439 return target is Source && AnalysisEngine.isDartFileName(target.fullName); | 441 return target is Source && AnalysisEngine.isDartFileName(target.fullName); |
| 440 } | 442 } |
| 441 } | 443 } |
| OLD | NEW |