Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: pkg/analyzer/lib/src/plugin/options_plugin.dart

Issue 2569603002: Remove the options plugin (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/plugin/engine_plugin.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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.src.plugin.options_plugin;
6
7 import 'package:analyzer/plugin/options.dart';
8 import 'package:analyzer/plugin/task.dart';
9 import 'package:analyzer/src/task/options.dart';
10 import 'package:plugin/plugin.dart';
11
12 /// A plugin that defines the extension points and extensions that are defined
13 /// by applications that want to consume options defined in the analysis
14 /// options file.
15 class OptionsPlugin implements Plugin {
16 /// The simple identifier of the extension point that allows plugins to
17 /// register new options validators.
18 static const String OPTIONS_VALIDATOR_EXTENSION_POINT = 'optionsValidator';
19
20 /// The unique identifier of this plugin.
21 static const String UNIQUE_IDENTIFIER = 'options.core';
22
23 /// The extension point that allows plugins to register new options
24 /// validators.
25 ExtensionPoint<OptionsValidator> optionsValidatorExtensionPoint;
26
27 /// All contributed options validators.
28 List<OptionsValidator> get optionsValidators =>
29 optionsValidatorExtensionPoint?.extensions ?? const <OptionsValidator>[];
30
31 @override
32 String get uniqueIdentifier => UNIQUE_IDENTIFIER;
33
34 @override
35 void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
36 optionsValidatorExtensionPoint = new ExtensionPoint<OptionsValidator>(
37 this, OPTIONS_VALIDATOR_EXTENSION_POINT, null);
38 registerExtensionPoint(optionsValidatorExtensionPoint);
39 }
40
41 @override
42 void registerExtensions(RegisterExtension registerExtension) {
43 // Analyze options files.
44 registerExtension(
45 TASK_EXTENSION_POINT_ID, GenerateOptionsErrorsTask.DESCRIPTOR);
46 // Validate analyzer analysis options.
47 registerExtension(
48 OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new AnalyzerOptionsValidator());
49 }
50 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/plugin/engine_plugin.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698