| 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.dart.local; | 5 library services.completion.computer.dart.local; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, Ele
mentKind; | 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, Ele
mentKind; |
| 10 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; | 10 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 _addParamListSuggestions(node.parameters); | 197 _addParamListSuggestions(node.parameters); |
| 198 visitNode(node); | 198 visitNode(node); |
| 199 } | 199 } |
| 200 | 200 |
| 201 @override | 201 @override |
| 202 visitNode(AstNode node) { | 202 visitNode(AstNode node) { |
| 203 node.parent.accept(this); | 203 node.parent.accept(this); |
| 204 } | 204 } |
| 205 | 205 |
| 206 @override | 206 @override |
| 207 visitCascadeExpression(CascadeExpression node) { |
| 208 Expression target = node.target; |
| 209 // This computer handles the expression |
| 210 // while InvocationComputer handles the cascade selector |
| 211 if (target != null && request.offset <= target.end) { |
| 212 visitNode(node); |
| 213 } |
| 214 } |
| 215 |
| 216 @override |
| 207 visitVariableDeclaration(VariableDeclaration node) { | 217 visitVariableDeclaration(VariableDeclaration node) { |
| 208 // Do not add suggestions if editing the name in a var declaration | 218 // Do not add suggestions if editing the name in a var declaration |
| 209 SimpleIdentifier name = node.name; | 219 SimpleIdentifier name = node.name; |
| 210 if (name == null || | 220 if (name == null || |
| 211 name.offset < request.offset || | 221 name.offset < request.offset || |
| 212 request.offset > name.end) { | 222 request.offset > name.end) { |
| 213 visitNode(node); | 223 visitNode(node); |
| 214 } | 224 } |
| 215 } | 225 } |
| 216 | 226 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 if (name == null || name.length <= 0) { | 443 if (name == null || name.length <= 0) { |
| 434 return DYNAMIC; | 444 return DYNAMIC; |
| 435 } | 445 } |
| 436 TypeArgumentList typeArgs = type.typeArguments; | 446 TypeArgumentList typeArgs = type.typeArguments; |
| 437 if (typeArgs != null) { | 447 if (typeArgs != null) { |
| 438 //TODO (danrubel) include type arguments | 448 //TODO (danrubel) include type arguments |
| 439 } | 449 } |
| 440 return name; | 450 return name; |
| 441 } | 451 } |
| 442 } | 452 } |
| OLD | NEW |