| 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 test.services.completion.suggestion; | 5 library test.services.completion.suggestion; |
| 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/completion_manager.dart'
; | 10 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 assertFull(int fullCount) { | 174 assertFull(int fullCount) { |
| 175 expect(this.fastCount, equals(1)); | 175 expect(this.fastCount, equals(1)); |
| 176 expect(this.fullCount, equals(fullCount)); | 176 expect(this.fullCount, equals(fullCount)); |
| 177 } | 177 } |
| 178 | 178 |
| 179 @override | 179 @override |
| 180 bool computeFast(DartCompletionRequest request) { | 180 bool computeFast(DartCompletionRequest request) { |
| 181 this.request = request; | 181 this.request = request; |
| 182 fastCount++; | 182 fastCount++; |
| 183 if (fastSuggestion != null) { | 183 if (fastSuggestion != null) { |
| 184 request.suggestions.add(fastSuggestion); | 184 request.addSuggestion(fastSuggestion); |
| 185 } | 185 } |
| 186 return fastSuggestion != null; | 186 return fastSuggestion != null; |
| 187 } | 187 } |
| 188 | 188 |
| 189 @override | 189 @override |
| 190 Future<bool> computeFull(DartCompletionRequest request) { | 190 Future<bool> computeFull(DartCompletionRequest request) { |
| 191 this.request = request; | 191 this.request = request; |
| 192 fullCount++; | 192 fullCount++; |
| 193 if (fullSuggestion != null) { | 193 if (fullSuggestion != null) { |
| 194 request.suggestions.add(fullSuggestion); | 194 request.addSuggestion(fullSuggestion); |
| 195 } | 195 } |
| 196 return new Future.value(fullSuggestion != null); | 196 return new Future.value(fullSuggestion != null); |
| 197 } | 197 } |
| 198 } | 198 } |
| OLD | NEW |