| 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, | 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, |
| 10 ElementKind; | 10 ElementKind; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 visitPrefixedIdentifier(PrefixedIdentifier node) { | 223 visitPrefixedIdentifier(PrefixedIdentifier node) { |
| 224 // InvocationComputer adds suggestions for prefixed elements | 224 // InvocationComputer adds suggestions for prefixed elements |
| 225 // but this computer adds suggestions for the prefix itself | 225 // but this computer adds suggestions for the prefix itself |
| 226 SimpleIdentifier prefix = node.prefix; | 226 SimpleIdentifier prefix = node.prefix; |
| 227 if (prefix == null || request.offset <= prefix.end) { | 227 if (prefix == null || request.offset <= prefix.end) { |
| 228 visitNode(node); | 228 visitNode(node); |
| 229 } | 229 } |
| 230 } | 230 } |
| 231 | 231 |
| 232 @override | 232 @override |
| 233 visitPropertyAccess(PropertyAccess node) { |
| 234 // InvocationComputer adds suggestions for property access selector |
| 235 } |
| 236 |
| 237 @override |
| 238 visitStringInterpolation(StringInterpolation node) { |
| 239 visitNode(node); |
| 240 } |
| 241 |
| 242 @override |
| 233 visitStringLiteral(StringLiteral node) { | 243 visitStringLiteral(StringLiteral node) { |
| 234 // ignore | 244 // ignore |
| 235 } | 245 } |
| 236 | 246 |
| 237 @override | 247 @override |
| 238 visitTypeName(TypeName node) { | 248 visitTypeName(TypeName node) { |
| 239 // If suggesting completions within a TypeName node | 249 // If suggesting completions within a TypeName node |
| 240 // then limit suggestions to only types | 250 // then limit suggestions to only types |
| 241 typesOnly = true; | 251 typesOnly = true; |
| 242 return visitNode(node); | 252 return visitNode(node); |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 if (name == null || name.length <= 0) { | 501 if (name == null || name.length <= 0) { |
| 492 return DYNAMIC; | 502 return DYNAMIC; |
| 493 } | 503 } |
| 494 TypeArgumentList typeArgs = type.typeArguments; | 504 TypeArgumentList typeArgs = type.typeArguments; |
| 495 if (typeArgs != null) { | 505 if (typeArgs != null) { |
| 496 //TODO (danrubel) include type arguments | 506 //TODO (danrubel) include type arguments |
| 497 } | 507 } |
| 498 return name; | 508 return name; |
| 499 } | 509 } |
| 500 } | 510 } |
| OLD | NEW |