| 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.provisional.completion.dart.plugin; | 5 library analysis_server.src.provisional.completion.dart.plugin; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/provisional/completion/completion.dart'; | 7 import 'package:analysis_server/src/provisional/completion/completion.dart'; |
| 8 import 'package:analysis_server/src/provisional/completion/dart/completion.dart'
; | 8 import 'package:analysis_server/src/provisional/completion/dart/completion.dart'
; |
| 9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
| 10 import 'package:analysis_server/src/services/completion/dart/arglist_contributor
.dart'; | 10 import 'package:analysis_server/src/services/completion/dart/arglist_contributor
.dart'; |
| 11 import 'package:analysis_server/src/services/completion/dart/combinator_contribu
tor.dart'; | 11 import 'package:analysis_server/src/services/completion/dart/combinator_contribu
tor.dart'; |
| 12 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart'; | 12 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart'; |
| 13 import 'package:analysis_server/src/services/completion/dart/field_formal_contri
butor.dart'; |
| 13 import 'package:analysis_server/src/services/completion/dart/keyword_contributor
.dart'; | 14 import 'package:analysis_server/src/services/completion/dart/keyword_contributor
.dart'; |
| 14 import 'package:analysis_server/src/services/completion/dart/uri_contributor.dar
t'; | 15 import 'package:analysis_server/src/services/completion/dart/uri_contributor.dar
t'; |
| 15 import 'package:plugin/plugin.dart'; | 16 import 'package:plugin/plugin.dart'; |
| 16 | 17 |
| 17 /** | 18 /** |
| 18 * The shared dart completion plugin instance. | 19 * The shared dart completion plugin instance. |
| 19 */ | 20 */ |
| 20 final DartCompletionPlugin dartCompletionPlugin = new DartCompletionPlugin(); | 21 final DartCompletionPlugin dartCompletionPlugin = new DartCompletionPlugin(); |
| 21 | 22 |
| 22 class DartCompletionPlugin implements Plugin { | 23 class DartCompletionPlugin implements Plugin { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 registerExtension(COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 66 registerExtension(COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 66 () => new DartCompletionManager()); | 67 () => new DartCompletionManager()); |
| 67 // | 68 // |
| 68 // Register the default DartCompletionContributors | 69 // Register the default DartCompletionContributors |
| 69 // | 70 // |
| 70 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 71 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 71 () => new ArgListContributor()); | 72 () => new ArgListContributor()); |
| 72 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 73 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 73 () => new CombinatorContributor()); | 74 () => new CombinatorContributor()); |
| 74 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 75 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 76 () => new FieldFormalContributor()); |
| 77 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 75 () => new KeywordContributor()); | 78 () => new KeywordContributor()); |
| 76 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 79 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 77 () => new UriContributor()); | 80 () => new UriContributor()); |
| 78 } | 81 } |
| 79 | 82 |
| 80 /** | 83 /** |
| 81 * Validate the given extension by throwing an [ExtensionError] if it is not a | 84 * Validate the given extension by throwing an [ExtensionError] if it is not a |
| 82 * valid Dart specific completion contributor. | 85 * valid Dart specific completion contributor. |
| 83 */ | 86 */ |
| 84 void _validateDartCompletionContributorExtension(Object extension) { | 87 void _validateDartCompletionContributorExtension(Object extension) { |
| 85 if (extension is! DartCompletionContributorFactory) { | 88 if (extension is! DartCompletionContributorFactory) { |
| 86 String id = _contributorExtensionPoint.uniqueIdentifier; | 89 String id = _contributorExtensionPoint.uniqueIdentifier; |
| 87 throw new ExtensionError( | 90 throw new ExtensionError( |
| 88 'Extensions to $id must be a DartCompletionContributorFactory'); | 91 'Extensions to $id must be a DartCompletionContributorFactory'); |
| 89 } | 92 } |
| 90 } | 93 } |
| 91 } | 94 } |
| OLD | NEW |