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 services.completion.dart.manager; | |
6 | |
7 import 'dart:async'; | 5 import 'dart:async'; |
8 | 6 |
9 import 'package:analysis_server/protocol/protocol_generated.dart'; | |
10 import 'package:analysis_server/src/ide_options.dart'; | 7 import 'package:analysis_server/src/ide_options.dart'; |
11 import 'package:analysis_server/src/provisional/completion/completion_core.dart' | 8 import 'package:analysis_server/src/provisional/completion/completion_core.dart' |
12 show CompletionContributor, CompletionRequest; | 9 show CompletionContributor, CompletionRequest; |
13 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 10 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
14 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; | 11 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; |
15 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'; |
16 import 'package:analysis_server/src/services/completion/completion_core.dart'; | 13 import 'package:analysis_server/src/services/completion/completion_core.dart'; |
17 import 'package:analysis_server/src/services/completion/completion_performance.d
art'; | 14 import 'package:analysis_server/src/services/completion/completion_performance.d
art'; |
18 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'; |
19 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; | 16 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; |
20 import 'package:analysis_server/src/services/completion/dart/optype.dart'; | 17 import 'package:analysis_server/src/services/completion/dart/optype.dart'; |
21 import 'package:analyzer/dart/ast/ast.dart'; | 18 import 'package:analyzer/dart/ast/ast.dart'; |
22 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 19 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
23 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 20 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
24 import 'package:analyzer/dart/ast/token.dart'; | 21 import 'package:analyzer/dart/ast/token.dart'; |
25 import 'package:analyzer/dart/element/element.dart'; | 22 import 'package:analyzer/dart/element/element.dart'; |
26 import 'package:analyzer/dart/element/type.dart'; | 23 import 'package:analyzer/dart/element/type.dart'; |
27 import 'package:analyzer/file_system/file_system.dart'; | 24 import 'package:analyzer/file_system/file_system.dart'; |
28 import 'package:analyzer/src/dart/analysis/driver.dart'; | 25 import 'package:analyzer/src/dart/analysis/driver.dart'; |
29 import 'package:analyzer/src/dart/ast/token.dart'; | 26 import 'package:analyzer/src/dart/ast/token.dart'; |
30 import 'package:analyzer/src/generated/engine.dart' hide AnalysisResult; | 27 import 'package:analyzer/src/generated/engine.dart' hide AnalysisResult; |
31 import 'package:analyzer/src/generated/source.dart'; | 28 import 'package:analyzer/src/generated/source.dart'; |
32 import 'package:analyzer/task/model.dart'; | 29 import 'package:analyzer/task/model.dart'; |
| 30 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
33 | 31 |
34 /** | 32 /** |
35 * [DartCompletionManager] determines if a completion request is Dart specific | 33 * [DartCompletionManager] determines if a completion request is Dart specific |
36 * and forwards those requests to all [DartCompletionContributor]s. | 34 * and forwards those requests to all [DartCompletionContributor]s. |
37 */ | 35 */ |
38 class DartCompletionManager implements CompletionContributor { | 36 class DartCompletionManager implements CompletionContributor { |
39 /** | 37 /** |
40 * The [contributionSorter] is a long-lived object that isn't allowed | 38 * The [contributionSorter] is a long-lived object that isn't allowed |
41 * to maintain state between calls to [DartContributionSorter#sort(...)]. | 39 * to maintain state between calls to [DartContributionSorter#sort(...)]. |
42 */ | 40 */ |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 if (start <= requestOffset && requestOffset <= end) { | 315 if (start <= requestOffset && requestOffset <= end) { |
318 // Replacement range for import URI | 316 // Replacement range for import URI |
319 return new ReplacementRange(start, end - start); | 317 return new ReplacementRange(start, end - start); |
320 } | 318 } |
321 } | 319 } |
322 } | 320 } |
323 } | 321 } |
324 return new ReplacementRange(requestOffset, 0); | 322 return new ReplacementRange(requestOffset, 0); |
325 } | 323 } |
326 } | 324 } |
OLD | NEW |