| 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 analysis_server.src.plugin.plugin_impl; | 5 library analysis_server.src.plugin.plugin_impl; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/plugin.dart'; | 9 import 'package:analysis_server/plugin/plugin.dart'; |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 /** | 23 /** |
| 24 * Process each of the given [plugins] by allowing them to register extension | 24 * Process each of the given [plugins] by allowing them to register extension |
| 25 * points and extensions. | 25 * points and extensions. |
| 26 * | 26 * |
| 27 * An [ExtensionError] will be thrown if any of the plugins throws such an | 27 * An [ExtensionError] will be thrown if any of the plugins throws such an |
| 28 * exception while registering with this manager. | 28 * exception while registering with this manager. |
| 29 */ | 29 */ |
| 30 void processPlugins(List<Plugin> plugins) { | 30 void processPlugins(List<Plugin> plugins) { |
| 31 for (Plugin plugin in plugins) { | 31 for (Plugin plugin in plugins) { |
| 32 plugin.registerExtensionPoints( | 32 plugin.registerExtensionPoints( |
| 33 (String identifier, [ExtensionValidator validator]) { | 33 (String identifier, [ExtensionValidator validator]) => |
| 34 registerExtensionPoint(plugin, identifier, validator); | 34 registerExtensionPoint(plugin, identifier, validator)); |
| 35 }); | |
| 36 } | 35 } |
| 37 for (Plugin plugin in plugins) { | 36 for (Plugin plugin in plugins) { |
| 38 plugin.registerExtensions(registerExtension); | 37 plugin.registerExtensions(registerExtension); |
| 39 } | 38 } |
| 40 } | 39 } |
| 41 | 40 |
| 42 /** | 41 /** |
| 43 * Register an [extension] to the extension point with the given unique | 42 * Register an [extension] to the extension point with the given unique |
| 44 * [identifier]. | 43 * [identifier]. |
| 45 */ | 44 */ |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 * Validate that the given [extension] is appropriate for this extension | 114 * Validate that the given [extension] is appropriate for this extension |
| 116 * point, and if it is then add it to the list of registered exceptions. | 115 * point, and if it is then add it to the list of registered exceptions. |
| 117 */ | 116 */ |
| 118 void add(Object extension) { | 117 void add(Object extension) { |
| 119 if (validator != null) { | 118 if (validator != null) { |
| 120 validator(extension); | 119 validator(extension); |
| 121 } | 120 } |
| 122 _extensions.add(extension); | 121 _extensions.add(extension); |
| 123 } | 122 } |
| 124 } | 123 } |
| OLD | NEW |