| 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'; | |
| 20 import 'package:analysis_server/src/services/completion/optype.dart'; | 19 import 'package:analysis_server/src/services/completion/optype.dart'; |
| 21 import 'package:analysis_server/src/services/search/search_engine.dart'; | 20 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 22 import 'package:analyzer/file_system/file_system.dart'; | 21 import 'package:analyzer/file_system/file_system.dart'; |
| 23 import 'package:analyzer/src/generated/ast.dart'; | 22 import 'package:analyzer/src/generated/ast.dart'; |
| 24 import 'package:analyzer/src/generated/engine.dart'; | 23 import 'package:analyzer/src/generated/engine.dart'; |
| 25 import 'package:analyzer/src/generated/scanner.dart'; | 24 import 'package:analyzer/src/generated/scanner.dart'; |
| 26 import 'package:analyzer/src/generated/source.dart'; | 25 import 'package:analyzer/src/generated/source.dart'; |
| 27 | 26 |
| 28 export 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart' | 27 export 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart' |
| 29 show | 28 show |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 85 |
| 87 DartCompletionManager( | 86 DartCompletionManager( |
| 88 AnalysisContext context, this.searchEngine, Source source, this.cache, | 87 AnalysisContext context, this.searchEngine, Source source, this.cache, |
| 89 [this.contributors, this.newContributors, this.contributionSorter]) | 88 [this.contributors, this.newContributors, this.contributionSorter]) |
| 90 : super(context, source) { | 89 : super(context, source) { |
| 91 if (contributors == null) { | 90 if (contributors == null) { |
| 92 contributors = [ | 91 contributors = [ |
| 93 // LocalReferenceContributor before ImportedReferenceContributor | 92 // LocalReferenceContributor before ImportedReferenceContributor |
| 94 // because local suggestions take precedence | 93 // because local suggestions take precedence |
| 95 // and can hide other suggestions with the same name | 94 // and can hide other suggestions with the same name |
| 96 new LocalReferenceContributor(), | 95 //new LocalReferenceContributor(), |
| 97 new ImportedReferenceContributor(), | 96 new ImportedReferenceContributor(), |
| 98 //new KeywordContributor(), | 97 //new KeywordContributor(), |
| 99 //new ArgListContributor(), | 98 //new ArgListContributor(), |
| 100 // new CombinatorContributor(), | 99 // new CombinatorContributor(), |
| 101 // new PrefixedElementContributor(), | 100 // new PrefixedElementContributor(), |
| 102 //new UriContributor(), | 101 //new UriContributor(), |
| 103 // TODO(brianwilkerson) Use the completion contributor extension point | 102 // TODO(brianwilkerson) Use the completion contributor extension point |
| 104 // to add the contributor below (and eventually, all the contributors). | 103 // to add the contributor below (and eventually, all the contributors). |
| 105 // new NewCompletionWrapper(new InheritedContributor()) | 104 // new NewCompletionWrapper(new InheritedContributor()) |
| 106 ]; | 105 ]; |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 // Replacement range for import URI | 479 // Replacement range for import URI |
| 481 return new ReplacementRange(start, end - start); | 480 return new ReplacementRange(start, end - start); |
| 482 } | 481 } |
| 483 } | 482 } |
| 484 } | 483 } |
| 485 } | 484 } |
| 486 } | 485 } |
| 487 return new ReplacementRange(requestOffset, 0); | 486 return new ReplacementRange(requestOffset, 0); |
| 488 } | 487 } |
| 489 } | 488 } |
| OLD | NEW |