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/completion_core.dart'; | 13 import 'package:analysis_server/src/services/completion/completion_core.dart'; |
14 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; | 14 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; |
15 import 'package:analysis_server/src/services/completion/dart/common_usage_sorter
.dart'; | 15 import 'package:analysis_server/src/services/completion/dart/common_usage_sorter
.dart'; |
16 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; | 16 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; |
17 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; | 17 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; |
18 import 'package:analysis_server/src/services/completion/imported_reference_contr
ibutor.dart'; | 18 import 'package:analysis_server/src/services/completion/imported_reference_contr
ibutor.dart'; |
19 import 'package:analysis_server/src/services/completion/local_reference_contribu
tor.dart'; | 19 import 'package:analysis_server/src/services/completion/local_reference_contribu
tor.dart'; |
20 import 'package:analysis_server/src/services/completion/optype.dart'; | 20 import 'package:analysis_server/src/services/completion/optype.dart'; |
21 import 'package:analysis_server/src/services/completion/prefixed_element_contrib
utor.dart'; | |
22 import 'package:analysis_server/src/services/search/search_engine.dart'; | 21 import 'package:analysis_server/src/services/search/search_engine.dart'; |
23 import 'package:analyzer/file_system/file_system.dart'; | 22 import 'package:analyzer/file_system/file_system.dart'; |
24 import 'package:analyzer/src/generated/ast.dart'; | 23 import 'package:analyzer/src/generated/ast.dart'; |
25 import 'package:analyzer/src/generated/engine.dart'; | 24 import 'package:analyzer/src/generated/engine.dart'; |
26 import 'package:analyzer/src/generated/scanner.dart'; | 25 import 'package:analyzer/src/generated/scanner.dart'; |
27 import 'package:analyzer/src/generated/source.dart'; | 26 import 'package:analyzer/src/generated/source.dart'; |
28 | 27 |
29 export 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart' | 28 export 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart' |
30 show | 29 show |
31 DART_RELEVANCE_COMMON_USAGE, | 30 DART_RELEVANCE_COMMON_USAGE, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if (contributors == null) { | 91 if (contributors == null) { |
93 contributors = [ | 92 contributors = [ |
94 // LocalReferenceContributor before ImportedReferenceContributor | 93 // LocalReferenceContributor before ImportedReferenceContributor |
95 // because local suggestions take precedence | 94 // because local suggestions take precedence |
96 // and can hide other suggestions with the same name | 95 // and can hide other suggestions with the same name |
97 new LocalReferenceContributor(), | 96 new LocalReferenceContributor(), |
98 new ImportedReferenceContributor(), | 97 new ImportedReferenceContributor(), |
99 //new KeywordContributor(), | 98 //new KeywordContributor(), |
100 //new ArgListContributor(), | 99 //new ArgListContributor(), |
101 // new CombinatorContributor(), | 100 // new CombinatorContributor(), |
102 new PrefixedElementContributor(), | 101 // new PrefixedElementContributor(), |
103 //new UriContributor(), | 102 //new UriContributor(), |
104 // TODO(brianwilkerson) Use the completion contributor extension point | 103 // TODO(brianwilkerson) Use the completion contributor extension point |
105 // to add the contributor below (and eventually, all the contributors). | 104 // to add the contributor below (and eventually, all the contributors). |
106 // new NewCompletionWrapper(new InheritedContributor()) | 105 // new NewCompletionWrapper(new InheritedContributor()) |
107 ]; | 106 ]; |
108 } | 107 } |
109 if (newContributors == null) { | 108 if (newContributors == null) { |
110 newContributors = <CompletionContributor>[]; | 109 newContributors = <CompletionContributor>[]; |
111 } | 110 } |
112 if (contributionSorter == null) { | 111 if (contributionSorter == null) { |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 // Replacement range for import URI | 480 // Replacement range for import URI |
482 return new ReplacementRange(start, end - start); | 481 return new ReplacementRange(start, end - start); |
483 } | 482 } |
484 } | 483 } |
485 } | 484 } |
486 } | 485 } |
487 } | 486 } |
488 return new ReplacementRange(requestOffset, 0); | 487 return new ReplacementRange(requestOffset, 0); |
489 } | 488 } |
490 } | 489 } |
OLD | NEW |