| 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/field_formal_contri
butor.dart'; |
| 14 import 'package:analysis_server/src/services/completion/dart/keyword_contributor
.dart'; | 14 import 'package:analysis_server/src/services/completion/dart/keyword_contributor
.dart'; |
| 15 import 'package:analysis_server/src/services/completion/dart/named_constructor_c
ontributor.dart'; |
| 15 import 'package:analysis_server/src/services/completion/dart/uri_contributor.dar
t'; | 16 import 'package:analysis_server/src/services/completion/dart/uri_contributor.dar
t'; |
| 16 import 'package:plugin/plugin.dart'; | 17 import 'package:plugin/plugin.dart'; |
| 17 | 18 |
| 18 /** | 19 /** |
| 19 * The shared dart completion plugin instance. | 20 * The shared dart completion plugin instance. |
| 20 */ | 21 */ |
| 21 final DartCompletionPlugin dartCompletionPlugin = new DartCompletionPlugin(); | 22 final DartCompletionPlugin dartCompletionPlugin = new DartCompletionPlugin(); |
| 22 | 23 |
| 23 class DartCompletionPlugin implements Plugin { | 24 class DartCompletionPlugin implements Plugin { |
| 24 /** | 25 /** |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // | 71 // |
| 71 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 72 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 72 () => new ArgListContributor()); | 73 () => new ArgListContributor()); |
| 73 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 74 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 74 () => new CombinatorContributor()); | 75 () => new CombinatorContributor()); |
| 75 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 76 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 76 () => new FieldFormalContributor()); | 77 () => new FieldFormalContributor()); |
| 77 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 78 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 78 () => new KeywordContributor()); | 79 () => new KeywordContributor()); |
| 79 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, | 80 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 81 () => new NamedConstructorContributor()); |
| 82 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, |
| 80 () => new UriContributor()); | 83 () => new UriContributor()); |
| 81 } | 84 } |
| 82 | 85 |
| 83 /** | 86 /** |
| 84 * Validate the given extension by throwing an [ExtensionError] if it is not a | 87 * Validate the given extension by throwing an [ExtensionError] if it is not a |
| 85 * valid Dart specific completion contributor. | 88 * valid Dart specific completion contributor. |
| 86 */ | 89 */ |
| 87 void _validateDartCompletionContributorExtension(Object extension) { | 90 void _validateDartCompletionContributorExtension(Object extension) { |
| 88 if (extension is! DartCompletionContributorFactory) { | 91 if (extension is! DartCompletionContributorFactory) { |
| 89 String id = _contributorExtensionPoint.uniqueIdentifier; | 92 String id = _contributorExtensionPoint.uniqueIdentifier; |
| 90 throw new ExtensionError( | 93 throw new ExtensionError( |
| 91 'Extensions to $id must be a DartCompletionContributorFactory'); | 94 'Extensions to $id must be a DartCompletionContributorFactory'); |
| 92 } | 95 } |
| 93 } | 96 } |
| 94 } | 97 } |
| OLD | NEW |