| 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.dart; | 5 library services.completion.dart; |
| 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/arglist_computer.dart'; | 10 import 'package:analysis_server/src/services/completion/arglist_computer.dart'; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 controller.close(); | 181 controller.close(); |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 | 184 |
| 185 /** | 185 /** |
| 186 * Return a future that either (a) completes with the resolved compilation | 186 * Return a future that either (a) completes with the resolved compilation |
| 187 * unit when analysis is complete, or (b) completes with null if the | 187 * unit when analysis is complete, or (b) completes with null if the |
| 188 * compilation unit is never going to be resolved. | 188 * compilation unit is never going to be resolved. |
| 189 */ | 189 */ |
| 190 Future<CompilationUnit> waitForAnalysis() { | 190 Future<CompilationUnit> waitForAnalysis() { |
| 191 return context.getResolvedCompilationUnitFuture( | 191 return context.computeResolvedCompilationUnitAsync( |
| 192 source, | 192 source, |
| 193 source).catchError((_) { | 193 source).catchError((_) { |
| 194 // This source file is not scheduled for analysis, so a resolved | 194 // This source file is not scheduled for analysis, so a resolved |
| 195 // compilation unit is never going to get computed. | 195 // compilation unit is never going to get computed. |
| 196 return null; | 196 return null; |
| 197 }, test: (e) => e is AnalysisNotScheduledError); | 197 }, test: (e) => e is AnalysisNotScheduledError); |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 /** | 201 /** |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 _ReplacementOffsetBuilder(this.request) { | 281 _ReplacementOffsetBuilder(this.request) { |
| 282 request.replacementOffset = request.offset; | 282 request.replacementOffset = request.offset; |
| 283 request.replacementLength = 0; | 283 request.replacementLength = 0; |
| 284 } | 284 } |
| 285 | 285 |
| 286 visitSimpleIdentifier(SimpleIdentifier node) { | 286 visitSimpleIdentifier(SimpleIdentifier node) { |
| 287 request.replacementOffset = node.offset; | 287 request.replacementOffset = node.offset; |
| 288 request.replacementLength = node.length; | 288 request.replacementLength = node.length; |
| 289 } | 289 } |
| 290 } | 290 } |
| OLD | NEW |