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'; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 * completion contributor factories. | 50 * completion contributor factories. |
51 */ | 51 */ |
52 ExtensionPoint _contributorExtensionPoint; | 52 ExtensionPoint _contributorExtensionPoint; |
53 | 53 |
54 @override | 54 @override |
55 String get uniqueIdentifier => UNIQUE_IDENTIFIER; | 55 String get uniqueIdentifier => UNIQUE_IDENTIFIER; |
56 | 56 |
57 /** | 57 /** |
58 * Return a list containing all of the Dart specific completion contributors. | 58 * Return a list containing all of the Dart specific completion contributors. |
59 */ | 59 */ |
60 Iterable<DartCompletionContributorFactory> get contributors => | 60 Iterable<DartCompletionContributor> get contributors => |
61 _contributorExtensionPoint.extensions | 61 _contributorExtensionPoint.extensions |
62 .map((DartCompletionContributorFactory factory) => factory()); | 62 .map((DartCompletionContributorFactory factory) => factory()); |
63 | 63 |
64 @override | 64 @override |
65 void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) { | 65 void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) { |
66 _contributorExtensionPoint = registerExtensionPoint( | 66 _contributorExtensionPoint = registerExtensionPoint( |
67 CONTRIBUTOR_EXTENSION_POINT, | 67 CONTRIBUTOR_EXTENSION_POINT, |
68 _validateDartCompletionContributorExtension); | 68 _validateDartCompletionContributorExtension); |
69 } | 69 } |
70 | 70 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 * valid Dart specific completion contributor. | 122 * valid Dart specific completion contributor. |
123 */ | 123 */ |
124 void _validateDartCompletionContributorExtension(Object extension) { | 124 void _validateDartCompletionContributorExtension(Object extension) { |
125 if (extension is! DartCompletionContributorFactory) { | 125 if (extension is! DartCompletionContributorFactory) { |
126 String id = _contributorExtensionPoint.uniqueIdentifier; | 126 String id = _contributorExtensionPoint.uniqueIdentifier; |
127 throw new ExtensionError( | 127 throw new ExtensionError( |
128 'Extensions to $id must be a DartCompletionContributorFactory'); | 128 'Extensions to $id must be a DartCompletionContributorFactory'); |
129 } | 129 } |
130 } | 130 } |
131 } | 131 } |
OLD | NEW |