| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 newCache = oldCache; | 74 newCache = oldCache; |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 if (newCache == null) { | 77 if (newCache == null) { |
| 78 newCache = new DartCompletionCache(context, source); | 78 newCache = new DartCompletionCache(context, source); |
| 79 } | 79 } |
| 80 return new DartCompletionManager(context, searchEngine, source, newCache); | 80 return new DartCompletionManager(context, searchEngine, source, newCache); |
| 81 } | 81 } |
| 82 | 82 |
| 83 @override | 83 @override |
| 84 void compute(CompletionRequest completionRequest) { | 84 void computeSuggestions(CompletionRequest completionRequest) { |
| 85 DartCompletionRequest request = new DartCompletionRequest( | 85 DartCompletionRequest request = new DartCompletionRequest( |
| 86 context, | 86 context, |
| 87 searchEngine, | 87 searchEngine, |
| 88 source, | 88 source, |
| 89 completionRequest.offset, | 89 completionRequest.offset, |
| 90 cache, | 90 cache, |
| 91 completionRequest.performance); | 91 completionRequest.performance); |
| 92 request.performance.logElapseTime('compute', () { | 92 request.performance.logElapseTime('compute', () { |
| 93 computeFast(request); | 93 computeFast(request); |
| 94 if (!computers.isEmpty) { | 94 if (!computers.isEmpty) { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 _ReplacementOffsetBuilder(this.request) { | 259 _ReplacementOffsetBuilder(this.request) { |
| 260 request.replacementOffset = request.offset; | 260 request.replacementOffset = request.offset; |
| 261 request.replacementLength = 0; | 261 request.replacementLength = 0; |
| 262 } | 262 } |
| 263 | 263 |
| 264 visitSimpleIdentifier(SimpleIdentifier node) { | 264 visitSimpleIdentifier(SimpleIdentifier node) { |
| 265 request.replacementOffset = node.offset; | 265 request.replacementOffset = node.offset; |
| 266 request.replacementLength = node.length; | 266 request.replacementLength = node.length; |
| 267 } | 267 } |
| 268 } | 268 } |
| OLD | NEW |