| 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.plugin.engine_plugin; | 5 library analyzer.src.plugin.engine_plugin; |
| 6 | 6 |
| 7 import 'package:analyzer/plugin/task.dart'; | 7 import 'package:analyzer/plugin/task.dart'; |
| 8 import 'package:analyzer/src/generated/engine.dart' | 8 import 'package:analyzer/src/generated/engine.dart' |
| 9 show InternalAnalysisContext; | 9 show InternalAnalysisContext; |
| 10 import 'package:analyzer/src/generated/error.dart' show AnalysisError; | 10 import 'package:analyzer/src/generated/error.dart' show AnalysisError; |
| 11 import 'package:analyzer/src/task/dart.dart'; | 11 import 'package:analyzer/src/task/dart.dart'; |
| 12 import 'package:analyzer/src/task/dart_work_manager.dart'; | 12 import 'package:analyzer/src/task/dart_work_manager.dart'; |
| 13 import 'package:analyzer/src/task/general.dart'; | 13 import 'package:analyzer/src/task/general.dart'; |
| 14 import 'package:analyzer/src/task/html.dart'; | 14 import 'package:analyzer/src/task/html.dart'; |
| 15 import 'package:analyzer/src/task/html_work_manager.dart'; | 15 import 'package:analyzer/src/task/html_work_manager.dart'; |
| 16 import 'package:analyzer/src/task/options_work_manager.dart'; |
| 16 import 'package:analyzer/task/model.dart'; | 17 import 'package:analyzer/task/model.dart'; |
| 17 import 'package:plugin/plugin.dart'; | 18 import 'package:plugin/plugin.dart'; |
| 18 | 19 |
| 19 /** | 20 /** |
| 20 * A plugin that defines the extension points and extensions that are inherently | 21 * A plugin that defines the extension points and extensions that are inherently |
| 21 * defined by the analysis engine. | 22 * defined by the analysis engine. |
| 22 */ | 23 */ |
| 23 class EnginePlugin implements Plugin { | 24 class EnginePlugin implements Plugin { |
| 24 /** | 25 /** |
| 25 * The simple identifier of the extension point that allows plugins to | 26 * The simple identifier of the extension point that allows plugins to |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 registerExtension(taskId, ParseHtmlTask.DESCRIPTOR); | 229 registerExtension(taskId, ParseHtmlTask.DESCRIPTOR); |
| 229 } | 230 } |
| 230 | 231 |
| 231 void _registerWorkManagerFactoryExtensions( | 232 void _registerWorkManagerFactoryExtensions( |
| 232 RegisterExtension registerExtension) { | 233 RegisterExtension registerExtension) { |
| 233 String taskId = WORK_MANAGER_EXTENSION_POINT_ID; | 234 String taskId = WORK_MANAGER_EXTENSION_POINT_ID; |
| 234 registerExtension(taskId, | 235 registerExtension(taskId, |
| 235 (InternalAnalysisContext context) => new DartWorkManager(context)); | 236 (InternalAnalysisContext context) => new DartWorkManager(context)); |
| 236 registerExtension(taskId, | 237 registerExtension(taskId, |
| 237 (InternalAnalysisContext context) => new HtmlWorkManager(context)); | 238 (InternalAnalysisContext context) => new HtmlWorkManager(context)); |
| 239 registerExtension(taskId, |
| 240 (InternalAnalysisContext context) => new OptionsWorkManager(context)); |
| 238 } | 241 } |
| 239 | 242 |
| 240 /** | 243 /** |
| 241 * Validate the given extension by throwing an [ExtensionError] if it is not | 244 * Validate the given extension by throwing an [ExtensionError] if it is not |
| 242 * a [ListResultDescriptor] of [AnalysisError]s. | 245 * a [ListResultDescriptor] of [AnalysisError]s. |
| 243 */ | 246 */ |
| 244 void _validateAnalysisErrorListResultDescriptor(Object extension) { | 247 void _validateAnalysisErrorListResultDescriptor(Object extension) { |
| 245 if (extension is! ListResultDescriptor<AnalysisError>) { | 248 if (extension is! ListResultDescriptor<AnalysisError>) { |
| 246 String id = taskExtensionPoint.uniqueIdentifier; | 249 String id = taskExtensionPoint.uniqueIdentifier; |
| 247 throw new ExtensionError( | 250 throw new ExtensionError( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 * passed to the extension manager to populate it. | 282 * passed to the extension manager to populate it. |
| 280 * | 283 * |
| 281 * This annotation is not used at runtime; it is used to aid in static analysis | 284 * This annotation is not used at runtime; it is used to aid in static analysis |
| 282 * of the task model during development. | 285 * of the task model during development. |
| 283 */ | 286 */ |
| 284 class ExtensionPointId { | 287 class ExtensionPointId { |
| 285 final String extensionPointId; | 288 final String extensionPointId; |
| 286 | 289 |
| 287 const ExtensionPointId(this.extensionPointId); | 290 const ExtensionPointId(this.extensionPointId); |
| 288 } | 291 } |
| OLD | NEW |