| 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 domain.completion; | 5 library domain.completion; |
| 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/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 recordRequest(performance, context, source, params.offset); | 179 recordRequest(performance, context, source, params.offset); |
| 180 | 180 |
| 181 CompletionRequestImpl completionRequest = new CompletionRequestImpl( | 181 CompletionRequestImpl completionRequest = new CompletionRequestImpl( |
| 182 result, | 182 result, |
| 183 context, | 183 context, |
| 184 server.resourceProvider, | 184 server.resourceProvider, |
| 185 server.searchEngine, | 185 server.searchEngine, |
| 186 source, | 186 source, |
| 187 params.offset, | 187 params.offset, |
| 188 performance); | 188 performance, |
| 189 server.ideOptions); |
| 189 String completionId = (_nextCompletionId++).toString(); | 190 String completionId = (_nextCompletionId++).toString(); |
| 190 | 191 |
| 191 _abortCurrentRequest(); | 192 _abortCurrentRequest(); |
| 192 _currentRequest = completionRequest; | 193 _currentRequest = completionRequest; |
| 193 | 194 |
| 194 // initial response without results | 195 // initial response without results |
| 195 server.sendResponse(new CompletionGetSuggestionsResult(completionId) | 196 server.sendResponse(new CompletionGetSuggestionsResult(completionId) |
| 196 .toResponse(request.id)); | 197 .toResponse(request.id)); |
| 197 | 198 |
| 198 // Compute suggestions in the background | 199 // Compute suggestions in the background |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 final int replacementOffset; | 278 final int replacementOffset; |
| 278 | 279 |
| 279 /** | 280 /** |
| 280 * The suggested completions. | 281 * The suggested completions. |
| 281 */ | 282 */ |
| 282 final List<CompletionSuggestion> suggestions; | 283 final List<CompletionSuggestion> suggestions; |
| 283 | 284 |
| 284 CompletionResult( | 285 CompletionResult( |
| 285 this.replacementOffset, this.replacementLength, this.suggestions); | 286 this.replacementOffset, this.replacementLength, this.suggestions); |
| 286 } | 287 } |
| OLD | NEW |