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/analysis/analysis_domain.dart'; | 7 import 'package:analysis_server/plugin/analysis/analysis_domain.dart'; |
8 import 'package:analysis_server/plugin/analysis/analyzed_files.dart'; | 8 import 'package:analysis_server/plugin/analysis/analyzed_files.dart'; |
9 import 'package:analysis_server/plugin/analysis/navigation/navigation.dart'; | 9 import 'package:analysis_server/plugin/analysis/navigation/navigation.dart'; |
10 import 'package:analysis_server/plugin/analysis/navigation/navigation_core.dart'
; | 10 import 'package:analysis_server/plugin/analysis/navigation/navigation_core.dart'
; |
(...skipping 13 matching lines...) Expand all Loading... |
24 import 'package:analysis_server/src/domain_experimental.dart'; | 24 import 'package:analysis_server/src/domain_experimental.dart'; |
25 import 'package:analysis_server/src/domain_server.dart'; | 25 import 'package:analysis_server/src/domain_server.dart'; |
26 import 'package:analysis_server/src/domains/analysis/navigation_dart.dart'; | 26 import 'package:analysis_server/src/domains/analysis/navigation_dart.dart'; |
27 import 'package:analysis_server/src/domains/analysis/occurrences_dart.dart'; | 27 import 'package:analysis_server/src/domains/analysis/occurrences_dart.dart'; |
28 import 'package:analysis_server/src/edit/edit_domain.dart'; | 28 import 'package:analysis_server/src/edit/edit_domain.dart'; |
29 import 'package:analysis_server/src/provisional/completion/completion_core.dart'
; | 29 import 'package:analysis_server/src/provisional/completion/completion_core.dart'
; |
30 import 'package:analysis_server/src/search/search_domain.dart'; | 30 import 'package:analysis_server/src/search/search_domain.dart'; |
31 import 'package:analysis_server/src/services/correction/assist_internal.dart'; | 31 import 'package:analysis_server/src/services/correction/assist_internal.dart'; |
32 import 'package:analysis_server/src/services/correction/fix_internal.dart'; | 32 import 'package:analysis_server/src/services/correction/fix_internal.dart'; |
33 import 'package:analysis_server/src/services/index/index_contributor.dart'; | 33 import 'package:analysis_server/src/services/index/index_contributor.dart'; |
34 import 'package:analysis_server/src/services/linter/linter.dart'; | |
35 import 'package:analyzer/file_system/file_system.dart'; | 34 import 'package:analyzer/file_system/file_system.dart'; |
36 import 'package:analyzer/plugin/options.dart'; | |
37 import 'package:analyzer/src/generated/engine.dart'; | 35 import 'package:analyzer/src/generated/engine.dart'; |
38 import 'package:plugin/plugin.dart'; | 36 import 'package:plugin/plugin.dart'; |
39 | 37 |
40 /** | 38 /** |
41 * A function that will create a request handler that can be used by the given | 39 * A function that will create a request handler that can be used by the given |
42 * [server]. | 40 * [server]. |
43 */ | 41 */ |
44 typedef RequestHandler RequestHandlerFactory(AnalysisServer server); | 42 typedef RequestHandler RequestHandlerFactory(AnalysisServer server); |
45 | 43 |
46 /** | 44 /** |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 // Register fix contributors. | 312 // Register fix contributors. |
315 // | 313 // |
316 registerExtension( | 314 registerExtension( |
317 FIX_CONTRIBUTOR_EXTENSION_POINT_ID, new DefaultFixContributor()); | 315 FIX_CONTRIBUTOR_EXTENSION_POINT_ID, new DefaultFixContributor()); |
318 // | 316 // |
319 // Register index contributors. | 317 // Register index contributors. |
320 // | 318 // |
321 registerExtension( | 319 registerExtension( |
322 INDEX_CONTRIBUTOR_EXTENSION_POINT_ID, new DartIndexContributor()); | 320 INDEX_CONTRIBUTOR_EXTENSION_POINT_ID, new DartIndexContributor()); |
323 | 321 |
324 // | |
325 // Register options validators. | |
326 // | |
327 registerExtension( | |
328 OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new LinterRuleOptionsValidator()); | |
329 } | 322 } |
330 | 323 |
331 /** | 324 /** |
332 * Validate the given extension by throwing an [ExtensionError] if it is not a | 325 * Validate the given extension by throwing an [ExtensionError] if it is not a |
333 * valid assist contributor. | 326 * valid assist contributor. |
334 */ | 327 */ |
335 void _validateAnalyzeFileExtension(Object extension) { | 328 void _validateAnalyzeFileExtension(Object extension) { |
336 if (extension is! ShouldAnalyzeFile) { | 329 if (extension is! ShouldAnalyzeFile) { |
337 String id = analyzeFileExtensionPoint.uniqueIdentifier; | 330 String id = analyzeFileExtensionPoint.uniqueIdentifier; |
338 throw new ExtensionError( | 331 throw new ExtensionError( |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 * valid analysis domain receiver. | 420 * valid analysis domain receiver. |
428 */ | 421 */ |
429 void _validateSetAnalysisDomainFunction(Object extension) { | 422 void _validateSetAnalysisDomainFunction(Object extension) { |
430 if (extension is! SetAnalysisDomain) { | 423 if (extension is! SetAnalysisDomain) { |
431 String id = setAnalysisDomainExtensionPoint.uniqueIdentifier; | 424 String id = setAnalysisDomainExtensionPoint.uniqueIdentifier; |
432 throw new ExtensionError( | 425 throw new ExtensionError( |
433 'Extensions to $id must be a SetAnalysisDomain function'); | 426 'Extensions to $id must be a SetAnalysisDomain function'); |
434 } | 427 } |
435 } | 428 } |
436 } | 429 } |
OLD | NEW |