OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 services.completion.dart; | 5 library services.completion.dart; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/provisional/completion/completion_core.dart' | 10 import 'package:analysis_server/src/provisional/completion/completion_core.dart' |
11 show AnalysisRequest, CompletionContributor, CompletionRequest; | 11 show AnalysisRequest, CompletionContributor, CompletionRequest; |
12 import 'package:analysis_server/src/provisional/completion/dart/completion_targe
t.dart'; | 12 import 'package:analysis_server/src/provisional/completion/dart/completion_targe
t.dart'; |
13 import 'package:analysis_server/src/services/completion/arglist_contributor.dart
'; | |
14 import 'package:analysis_server/src/services/completion/combinator_contributor.d
art'; | 13 import 'package:analysis_server/src/services/completion/combinator_contributor.d
art'; |
15 import 'package:analysis_server/src/services/completion/completion_core.dart'; | 14 import 'package:analysis_server/src/services/completion/completion_core.dart'; |
16 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; | 15 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; |
17 import 'package:analysis_server/src/services/completion/dart/common_usage_sorter
.dart'; | 16 import 'package:analysis_server/src/services/completion/dart/common_usage_sorter
.dart'; |
18 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; | 17 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; |
19 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; | 18 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; |
20 import 'package:analysis_server/src/services/completion/imported_reference_contr
ibutor.dart'; | 19 import 'package:analysis_server/src/services/completion/imported_reference_contr
ibutor.dart'; |
21 import 'package:analysis_server/src/services/completion/local_reference_contribu
tor.dart'; | 20 import 'package:analysis_server/src/services/completion/local_reference_contribu
tor.dart'; |
22 import 'package:analysis_server/src/services/completion/optype.dart'; | 21 import 'package:analysis_server/src/services/completion/optype.dart'; |
23 import 'package:analysis_server/src/services/completion/prefixed_element_contrib
utor.dart'; | 22 import 'package:analysis_server/src/services/completion/prefixed_element_contrib
utor.dart'; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 [this.contributors, this.newContributors, this.contributionSorter]) | 92 [this.contributors, this.newContributors, this.contributionSorter]) |
94 : super(context, source) { | 93 : super(context, source) { |
95 if (contributors == null) { | 94 if (contributors == null) { |
96 contributors = [ | 95 contributors = [ |
97 // LocalReferenceContributor before ImportedReferenceContributor | 96 // LocalReferenceContributor before ImportedReferenceContributor |
98 // because local suggestions take precedence | 97 // because local suggestions take precedence |
99 // and can hide other suggestions with the same name | 98 // and can hide other suggestions with the same name |
100 new LocalReferenceContributor(), | 99 new LocalReferenceContributor(), |
101 new ImportedReferenceContributor(), | 100 new ImportedReferenceContributor(), |
102 //new KeywordContributor(), | 101 //new KeywordContributor(), |
103 new ArgListContributor(), | 102 //new ArgListContributor(), |
104 new CombinatorContributor(), | 103 new CombinatorContributor(), |
105 new PrefixedElementContributor(), | 104 new PrefixedElementContributor(), |
106 new UriContributor(), | 105 new UriContributor(), |
107 // TODO(brianwilkerson) Use the completion contributor extension point | 106 // TODO(brianwilkerson) Use the completion contributor extension point |
108 // to add the contributor below (and eventually, all the contributors). | 107 // to add the contributor below (and eventually, all the contributors). |
109 // new NewCompletionWrapper(new InheritedContributor()) | 108 // new NewCompletionWrapper(new InheritedContributor()) |
110 ]; | 109 ]; |
111 } | 110 } |
112 if (newContributors == null) { | 111 if (newContributors == null) { |
113 newContributors = <CompletionContributor>[ | 112 newContributors = <CompletionContributor>[]; |
114 // TODO(danrubel) initialize using plugin API | |
115 //new newImpl.DartCompletionManager(), | |
116 ]; | |
117 } | 113 } |
118 if (contributionSorter == null) { | 114 if (contributionSorter == null) { |
119 contributionSorter = defaultContributionSorter; | 115 contributionSorter = defaultContributionSorter; |
120 } | 116 } |
121 } | 117 } |
122 | 118 |
123 /** | 119 /** |
124 * Create a new initialized Dart source completion manager | 120 * Create a new initialized Dart source completion manager |
125 */ | 121 */ |
126 factory DartCompletionManager.create( | 122 factory DartCompletionManager.create( |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 parameterNames: suggestion.parameterNames, | 444 parameterNames: suggestion.parameterNames, |
449 parameterTypes: suggestion.parameterTypes, | 445 parameterTypes: suggestion.parameterTypes, |
450 requiredParameterCount: suggestion.requiredParameterCount, | 446 requiredParameterCount: suggestion.requiredParameterCount, |
451 hasNamedParameters: suggestion.hasNamedParameters, | 447 hasNamedParameters: suggestion.hasNamedParameters, |
452 returnType: suggestion.returnType, | 448 returnType: suggestion.returnType, |
453 element: suggestion.element); | 449 element: suggestion.element); |
454 } | 450 } |
455 } | 451 } |
456 } | 452 } |
457 } | 453 } |
OLD | NEW |