OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library analyzer_cli.src.plugin.plugin_config_processor; | |
6 | |
7 import 'package:analyzer/plugin/options.dart'; | |
8 import 'package:analyzer/src/plugin/plugin_configuration.dart'; | |
9 import 'package:plugin/plugin.dart'; | |
10 | |
11 /// A plugin that registers an extension to process plugin configurations | |
12 /// as defined in .`analysis options`. | |
13 class PluginConfigProcessorPlugin implements Plugin { | |
14 /// The unique identifier of this plugin. | |
15 static const String UNIQUE_IDENTIFIER = 'plugin_config_processor.core'; | |
16 | |
17 final PluginConfigOptionsProcessor _optionProcessor; | |
18 | |
19 PluginConfigProcessorPlugin([ErrorHandler handler]) | |
20 : _optionProcessor = new PluginConfigOptionsProcessor(handler); | |
21 | |
22 PluginConfig get pluginConfig => _optionProcessor.config; | |
23 | |
24 @override | |
25 String get uniqueIdentifier => UNIQUE_IDENTIFIER; | |
26 | |
27 @override | |
28 void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) { | |
29 // There are no extension points. | |
30 } | |
31 | |
32 @override | |
33 void registerExtensions(RegisterExtension registerExtension) { | |
34 registerExtension(OPTIONS_PROCESSOR_EXTENSION_POINT_ID, _optionProcessor); | |
35 } | |
36 } | |
OLD | NEW |