| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 CompletionManager(); | 44 CompletionManager(); |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * Create a manager for the given request. | 47 * Create a manager for the given request. |
| 48 */ | 48 */ |
| 49 factory CompletionManager.create(AnalysisContext context, Source source, | 49 factory CompletionManager.create(AnalysisContext context, Source source, |
| 50 int offset, SearchEngine searchEngine, CompletionCache cache, | 50 int offset, SearchEngine searchEngine, CompletionCache cache, |
| 51 CompletionPerformance performance) { | 51 CompletionPerformance performance) { |
| 52 if (context != null) { | 52 if (context != null) { |
| 53 if (AnalysisEngine.isDartFileName(source.shortName)) { | 53 if (AnalysisEngine.isDartFileName(source.shortName)) { |
| 54 return new DartCompletionManager( | 54 return new DartCompletionManager.create( |
| 55 context, | 55 context, |
| 56 searchEngine, | 56 searchEngine, |
| 57 source, | 57 source, |
| 58 offset, | 58 offset, |
| 59 cache, |
| 59 performance); | 60 performance); |
| 60 } | 61 } |
| 61 if (AnalysisEngine.isHtmlFileName(source.shortName)) { | 62 if (AnalysisEngine.isHtmlFileName(source.shortName)) { |
| 62 //TODO (danrubel) implement | 63 //TODO (danrubel) implement |
| 63 // return new HtmlCompletionManager(context, searchEngine, source, offset
); | 64 // return new HtmlCompletionManager(context, searchEngine, source, offset
); |
| 64 } | 65 } |
| 65 } | 66 } |
| 66 return new NoOpCompletionManager(source, offset); | 67 return new NoOpCompletionManager(source, offset); |
| 67 } | 68 } |
| 68 | 69 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 */ | 195 */ |
| 195 final String name; | 196 final String name; |
| 196 | 197 |
| 197 /** | 198 /** |
| 198 * The elapse time or `null` if undefined. | 199 * The elapse time or `null` if undefined. |
| 199 */ | 200 */ |
| 200 final Duration elapsed; | 201 final Duration elapsed; |
| 201 | 202 |
| 202 OperationPerformance(this.name, this.elapsed); | 203 OperationPerformance(this.name, this.elapsed); |
| 203 } | 204 } |
| OLD | NEW |