| 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.server_plugin; | 5 library analysis_server.src.plugin.server_plugin; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/plugin.dart'; | |
| 8 import 'package:analysis_server/src/analysis_server.dart'; | 7 import 'package:analysis_server/src/analysis_server.dart'; |
| 9 import 'package:analysis_server/src/domain_analysis.dart'; | 8 import 'package:analysis_server/src/domain_analysis.dart'; |
| 10 import 'package:analysis_server/src/domain_completion.dart'; | 9 import 'package:analysis_server/src/domain_completion.dart'; |
| 11 import 'package:analysis_server/src/domain_execution.dart'; | 10 import 'package:analysis_server/src/domain_execution.dart'; |
| 12 import 'package:analysis_server/src/domain_server.dart'; | 11 import 'package:analysis_server/src/domain_server.dart'; |
| 13 import 'package:analysis_server/src/edit/edit_domain.dart'; | 12 import 'package:analysis_server/src/edit/edit_domain.dart'; |
| 14 import 'package:analysis_server/src/protocol.dart'; | 13 import 'package:analysis_server/src/protocol.dart'; |
| 15 import 'package:analysis_server/src/search/search_domain.dart'; | 14 import 'package:analysis_server/src/search/search_domain.dart'; |
| 15 import 'package:analyzer/plugin/plugin.dart'; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * A function that will create a request handler that can be used by the given | 18 * A function that will create a request handler that can be used by the given |
| 19 * [server]. | 19 * [server]. |
| 20 * | |
| 21 * TODO(brianwilkerson) Move this into 'protocol.dart'. | |
| 22 */ | 20 */ |
| 23 typedef RequestHandler RequestHandlerFactory(AnalysisServer server); | 21 typedef RequestHandler RequestHandlerFactory(AnalysisServer server); |
| 24 | 22 |
| 25 /** | 23 /** |
| 26 * A plugin that defines the extension points and extensions that are inherently | 24 * A plugin that defines the extension points and extensions that are inherently |
| 27 * defined by the analysis server. | 25 * defined by the analysis server. |
| 28 */ | 26 */ |
| 29 class ServerPlugin implements Plugin { | 27 class ServerPlugin implements Plugin { |
| 30 /** | 28 /** |
| 31 * The simple identifier of the extension point that allows plugins to | 29 * The simple identifier of the extension point that allows plugins to |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 * valid domain. | 91 * valid domain. |
| 94 */ | 92 */ |
| 95 void _validateDomainExtension(Object extension) { | 93 void _validateDomainExtension(Object extension) { |
| 96 if (extension is! RequestHandlerFactory) { | 94 if (extension is! RequestHandlerFactory) { |
| 97 String id = domainExtensionPoint.uniqueIdentifier; | 95 String id = domainExtensionPoint.uniqueIdentifier; |
| 98 throw new ExtensionError( | 96 throw new ExtensionError( |
| 99 'Extensions to $id must be a RequestHandlerFactory'); | 97 'Extensions to $id must be a RequestHandlerFactory'); |
| 100 } | 98 } |
| 101 } | 99 } |
| 102 } | 100 } |
| OLD | NEW |