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