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

Unified Diff: pkg/analyzer/lib/src/plugin/command_line_plugin.dart

Issue 1965083002: Update to use the latest version of the plugin package (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Patch version info Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/pubspec.yaml ('k') | pkg/analyzer/lib/src/plugin/engine_plugin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/plugin/command_line_plugin.dart
diff --git a/pkg/analyzer/lib/src/plugin/command_line_plugin.dart b/pkg/analyzer/lib/src/plugin/command_line_plugin.dart
index ffd43be46e6a3a6e6e1e96b1d07d00bc8daf2467..b2f8c582cdbb530fb642291acd6956f6e96447d3 100644
--- a/pkg/analyzer/lib/src/plugin/command_line_plugin.dart
+++ b/pkg/analyzer/lib/src/plugin/command_line_plugin.dart
@@ -33,12 +33,12 @@ class CommandLinePlugin implements Plugin {
* The extension point that allows plugins to register new parser
* contributors.
*/
- ExtensionPoint parserContributorExtensionPoint;
+ ExtensionPoint<ArgParserContributor> parserContributorExtensionPoint;
/**
* The extension point that allows plugins to register new result processors.
*/
- ExtensionPoint resultProcessorExtensionPoint;
+ ExtensionPoint<ArgResultsProcessor> resultProcessorExtensionPoint;
/**
* Initialize a newly created plugin.
@@ -64,39 +64,16 @@ class CommandLinePlugin implements Plugin {
@override
void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
- parserContributorExtensionPoint = registerExtensionPoint(
- PARSER_CONTRIBUTOR_EXTENSION_POINT,
- _validateParserContributorExtension);
- resultProcessorExtensionPoint = registerExtensionPoint(
- RESULT_PROCESSOR_EXTENSION_POINT, _validateResultProcessorExtension);
+ parserContributorExtensionPoint = new ExtensionPoint<ArgParserContributor>(
+ this, PARSER_CONTRIBUTOR_EXTENSION_POINT, null);
+ registerExtensionPoint(parserContributorExtensionPoint);
+ resultProcessorExtensionPoint = new ExtensionPoint<ArgResultsProcessor>(
+ this, RESULT_PROCESSOR_EXTENSION_POINT, null);
+ registerExtensionPoint(resultProcessorExtensionPoint);
}
@override
void registerExtensions(RegisterExtension registerExtension) {
// There are no default extensions.
}
-
- /**
- * Validate the given extension by throwing an [ExtensionError] if it is not a
- * valid parser contributor.
- */
- void _validateParserContributorExtension(Object extension) {
- if (extension is! ArgParserContributor) {
- String id = parserContributorExtensionPoint.uniqueIdentifier;
- throw new ExtensionError(
- 'Extensions to $id must be an ArgParserContributor');
- }
- }
-
- /**
- * Validate the given extension by throwing an [ExtensionError] if it is not a
- * valid result processor.
- */
- void _validateResultProcessorExtension(Object extension) {
- if (extension is! ArgResultsProcessor) {
- String id = resultProcessorExtensionPoint.uniqueIdentifier;
- throw new ExtensionError(
- 'Extensions to $id must be an ArgResultsProcessor');
- }
- }
}
« no previous file with comments | « pkg/analysis_server/pubspec.yaml ('k') | pkg/analyzer/lib/src/plugin/engine_plugin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698