Index: pkg/analysis_server/lib/src/plugin/linter_plugin.dart |
diff --git a/pkg/analysis_server/lib/src/plugin/linter_plugin.dart b/pkg/analysis_server/lib/src/plugin/linter_plugin.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..07fb54e3ca17607408d62ac9d2f63afd5b1968fd |
--- /dev/null |
+++ b/pkg/analysis_server/lib/src/plugin/linter_plugin.dart |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+library analysis_server.src.plugin.linter_plugin; |
+ |
+import 'package:analysis_server/src/services/linter/linter.dart'; |
+import 'package:analyzer/plugin/options.dart'; |
+import 'package:plugin/plugin.dart'; |
+ |
+/// The shared linter server plugin instance. |
+final LinterServerPlugin linterServerPlugin = new LinterServerPlugin(); |
+ |
+/// A plugin that defines the extension points and extensions that enhance |
+/// linting in the server. |
+class LinterServerPlugin implements Plugin { |
+ /// The unique identifier of this plugin. |
+ static const String UNIQUE_IDENTIFIER = 'linter.server'; |
+ |
+ @override |
+ String get uniqueIdentifier => UNIQUE_IDENTIFIER; |
+ |
+ @override |
+ void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) { |
+ // None. |
+ } |
+ |
+ @override |
+ void registerExtensions(RegisterExtension registerExtension) { |
+ // |
+ // Register options validators. |
+ // |
+ registerExtension( |
+ OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new LinterRuleOptionsValidator()); |
+ } |
+} |