| 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.computer; | 5 library services.completion.computer; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart'; | 9 import 'package:analysis_server/src/protocol.dart'; |
| 10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 * The controller used for returning completion results. | 50 * The controller used for returning completion results. |
| 51 */ | 51 */ |
| 52 StreamController<CompletionResult> controller; | 52 StreamController<CompletionResult> controller; |
| 53 | 53 |
| 54 CompletionManager(this.context, this.source); | 54 CompletionManager(this.context, this.source); |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * Create a manager for the given request. | 57 * Create a manager for the given request. |
| 58 */ | 58 */ |
| 59 factory CompletionManager.create(AnalysisContext context, Source source, | 59 factory CompletionManager.create(AnalysisContext context, Source source, |
| 60 SearchEngine searchEngine, CompletionCache cache) { | 60 SearchEngine searchEngine) { |
| 61 if (context != null) { | 61 if (context != null) { |
| 62 if (AnalysisEngine.isDartFileName(source.shortName)) { | 62 if (AnalysisEngine.isDartFileName(source.shortName)) { |
| 63 return new DartCompletionManager.create( | 63 return new DartCompletionManager.create(context, searchEngine, source); |
| 64 context, | |
| 65 searchEngine, | |
| 66 source, | |
| 67 cache); | |
| 68 } | 64 } |
| 69 if (AnalysisEngine.isHtmlFileName(source.shortName)) { | 65 if (AnalysisEngine.isHtmlFileName(source.shortName)) { |
| 70 //TODO (danrubel) implement | 66 //TODO (danrubel) implement |
| 71 // return new HtmlCompletionManager(context, searchEngine, source, offset
); | 67 // return new HtmlCompletionManager(context, searchEngine, source, offset
); |
| 72 } | 68 } |
| 73 } | 69 } |
| 74 return new NoOpCompletionManager(source); | 70 return new NoOpCompletionManager(source); |
| 75 } | 71 } |
| 76 | 72 |
| 77 /** | 73 /** |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 */ | 218 */ |
| 223 final String name; | 219 final String name; |
| 224 | 220 |
| 225 /** | 221 /** |
| 226 * The elapse time or `null` if undefined. | 222 * The elapse time or `null` if undefined. |
| 227 */ | 223 */ |
| 228 final Duration elapsed; | 224 final Duration elapsed; |
| 229 | 225 |
| 230 OperationPerformance(this.name, this.elapsed); | 226 OperationPerformance(this.name, this.elapsed); |
| 231 } | 227 } |
| OLD | NEW |