| 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; | 5 library services.completion.dart.manager; |
| 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 CompletionContributor, CompletionRequest; | 11 show CompletionContributor, CompletionRequest; |
| 12 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 12 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
| 13 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; | 13 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; |
| 14 import 'package:analysis_server/src/provisional/completion/dart/completion_targe
t.dart'; | 14 import 'package:analysis_server/src/provisional/completion/dart/completion_targe
t.dart'; |
| 15 import 'package:analysis_server/src/services/completion/completion_core.dart'; | 15 import 'package:analysis_server/src/services/completion/completion_core.dart'; |
| 16 import 'package:analysis_server/src/services/completion/optype.dart'; | 16 import 'package:analysis_server/src/services/completion/dart/common_usage_sorter
.dart'; |
| 17 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; |
| 18 import 'package:analysis_server/src/services/completion/dart/optype.dart'; |
| 17 import 'package:analysis_server/src/services/search/search_engine.dart'; | 19 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 18 import 'package:analyzer/dart/element/element.dart'; | 20 import 'package:analyzer/dart/element/element.dart'; |
| 19 import 'package:analyzer/dart/element/type.dart'; | 21 import 'package:analyzer/dart/element/type.dart'; |
| 20 import 'package:analyzer/file_system/file_system.dart'; | 22 import 'package:analyzer/file_system/file_system.dart'; |
| 21 import 'package:analyzer/src/context/context.dart' | 23 import 'package:analyzer/src/context/context.dart' |
| 22 show AnalysisFutureHelper, AnalysisContextImpl; | 24 show AnalysisFutureHelper, AnalysisContextImpl; |
| 23 import 'package:analyzer/src/generated/ast.dart'; | 25 import 'package:analyzer/src/generated/ast.dart'; |
| 24 import 'package:analyzer/src/generated/engine.dart' hide AnalysisContextImpl; | 26 import 'package:analyzer/src/generated/engine.dart' hide AnalysisContextImpl; |
| 27 import 'package:analyzer/src/generated/scanner.dart'; |
| 25 import 'package:analyzer/src/generated/source.dart'; | 28 import 'package:analyzer/src/generated/source.dart'; |
| 26 import 'package:analyzer/src/task/dart.dart'; | 29 import 'package:analyzer/src/task/dart.dart'; |
| 27 import 'package:analyzer/task/dart.dart'; | 30 import 'package:analyzer/task/dart.dart'; |
| 28 import 'package:analyzer/src/generated/scanner.dart'; | |
| 29 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; | |
| 30 import 'package:analysis_server/src/services/completion/dart/common_usage_sorter
.dart'; | |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * [DartCompletionManager] determines if a completion request is Dart specific | 33 * [DartCompletionManager] determines if a completion request is Dart specific |
| 34 * and forwards those requests to all [DartCompletionContributor]s. | 34 * and forwards those requests to all [DartCompletionContributor]s. |
| 35 */ | 35 */ |
| 36 class DartCompletionManager implements CompletionContributor { | 36 class DartCompletionManager implements CompletionContributor { |
| 37 /** | 37 /** |
| 38 * The [contributionSorter] is a long-lived object that isn't allowed | 38 * The [contributionSorter] is a long-lived object that isn't allowed |
| 39 * to maintain state between calls to [DartContributionSorter#sort(...)]. | 39 * to maintain state between calls to [DartContributionSorter#sort(...)]. |
| 40 */ | 40 */ |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 // Replacement range for import URI | 360 // Replacement range for import URI |
| 361 return new ReplacementRange(start, end - start); | 361 return new ReplacementRange(start, end - start); |
| 362 } | 362 } |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 return new ReplacementRange(requestOffset, 0); | 367 return new ReplacementRange(requestOffset, 0); |
| 368 } | 368 } |
| 369 } | 369 } |
| OLD | NEW |