| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 * The unique identifier of this plugin. | 44 * The unique identifier of this plugin. |
| 45 */ | 45 */ |
| 46 static const String UNIQUE_IDENTIFIER = 'dart.completion'; | 46 static const String UNIQUE_IDENTIFIER = 'dart.completion'; |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * The extension point that allows plugins to register Dart specific | 49 * The extension point that allows plugins to register Dart specific |
| 50 * completion contributor factories. | 50 * completion contributor factories. |
| 51 */ | 51 */ |
| 52 ExtensionPoint _contributorExtensionPoint; | 52 ExtensionPoint _contributorExtensionPoint; |
| 53 | 53 |
| 54 @override | |
| 55 String get uniqueIdentifier => UNIQUE_IDENTIFIER; | |
| 56 | |
| 57 /** | 54 /** |
| 58 * Return a list containing all of the Dart specific completion contributors. | 55 * Return a list containing all of the Dart specific completion contributors. |
| 59 */ | 56 */ |
| 60 Iterable<DartCompletionContributor> get contributors => | 57 Iterable<DartCompletionContributor> get contributors => |
| 61 _contributorExtensionPoint.extensions | 58 _contributorExtensionPoint.extensions |
| 62 .map((DartCompletionContributorFactory factory) => factory()); | 59 .map((DartCompletionContributorFactory factory) => factory()); |
| 63 | 60 |
| 64 @override | 61 @override |
| 62 String get uniqueIdentifier => UNIQUE_IDENTIFIER; |
| 63 |
| 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 |
| 71 @override | 71 @override |
| 72 void registerExtensions(RegisterExtension registerExtension) { | 72 void registerExtensions(RegisterExtension registerExtension) { |
| 73 // | 73 // |
| 74 // Register DartCompletionManager as a CompletionContributor | 74 // Register DartCompletionManager as a CompletionContributor |
| (...skipping 47 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 |