| 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.manager; | 5 library services.completion.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, CompletionContributorFactory, CompletionRequest,
CompletionResult; | 11 show CompletionContributor, CompletionContributorFactory, CompletionRequest,
CompletionResult; |
| 12 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 12 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 13 import 'package:analysis_server/src/services/search/search_engine.dart'; | 13 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 14 import 'package:analyzer/src/generated/engine.dart'; | 14 import 'package:analyzer/src/generated/engine.dart'; |
| 15 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * [CompletionCache] contains information about the prior code completion | |
| 19 * for use in the next code completion. | |
| 20 */ | |
| 21 abstract class CompletionCache { | |
| 22 /** | |
| 23 * The context in which the completion was computed. | |
| 24 */ | |
| 25 final AnalysisContext context; | |
| 26 | |
| 27 /** | |
| 28 * The source in which the completion was computed. | |
| 29 */ | |
| 30 final Source source; | |
| 31 | |
| 32 CompletionCache(this.context, this.source); | |
| 33 } | |
| 34 | |
| 35 /** | |
| 36 * Manages completion contributors for a given completion request. | 18 * Manages completion contributors for a given completion request. |
| 37 */ | 19 */ |
| 38 abstract class CompletionManager { | 20 abstract class CompletionManager { |
| 39 /** | 21 /** |
| 40 * The context in which the completion was computed. | 22 * The context in which the completion was computed. |
| 41 */ | 23 */ |
| 42 final AnalysisContext context; | 24 final AnalysisContext context; |
| 43 | 25 |
| 44 /** | 26 /** |
| 45 * The source in which the completion was computed. | 27 * The source in which the completion was computed. |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 */ | 253 */ |
| 272 final String name; | 254 final String name; |
| 273 | 255 |
| 274 /** | 256 /** |
| 275 * The elapse time or `null` if undefined. | 257 * The elapse time or `null` if undefined. |
| 276 */ | 258 */ |
| 277 final Duration elapsed; | 259 final Duration elapsed; |
| 278 | 260 |
| 279 OperationPerformance(this.name, this.elapsed); | 261 OperationPerformance(this.name, this.elapsed); |
| 280 } | 262 } |
| OLD | NEW |