| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 visitNode(node); | 198 visitNode(node); |
| 199 } | 199 } |
| 200 | 200 |
| 201 @override | 201 @override |
| 202 visitMethodDeclaration(MethodDeclaration node) { | 202 visitMethodDeclaration(MethodDeclaration node) { |
| 203 _addParamListSuggestions(node.parameters); | 203 _addParamListSuggestions(node.parameters); |
| 204 visitNode(node); | 204 visitNode(node); |
| 205 } | 205 } |
| 206 | 206 |
| 207 @override | 207 @override |
| 208 visitNamespaceDirective(NamespaceDirective node) { |
| 209 // No suggestions |
| 210 } |
| 211 |
| 212 @override |
| 208 visitNode(AstNode node) { | 213 visitNode(AstNode node) { |
| 209 node.parent.accept(this); | 214 node.parent.accept(this); |
| 210 } | 215 } |
| 211 | 216 |
| 212 @override | 217 @override |
| 213 visitPrefixedIdentifier(PrefixedIdentifier node) { | 218 visitPrefixedIdentifier(PrefixedIdentifier node) { |
| 214 // InvocationComputer adds suggestions for prefixed elements | 219 // InvocationComputer adds suggestions for prefixed elements |
| 215 // but this computer adds suggestions for the prefix itself | 220 // but this computer adds suggestions for the prefix itself |
| 216 SimpleIdentifier prefix = node.prefix; | 221 SimpleIdentifier prefix = node.prefix; |
| 217 if (prefix == null || request.offset <= prefix.end) { | 222 if (prefix == null || request.offset <= prefix.end) { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 if (name == null || name.length <= 0) { | 481 if (name == null || name.length <= 0) { |
| 477 return DYNAMIC; | 482 return DYNAMIC; |
| 478 } | 483 } |
| 479 TypeArgumentList typeArgs = type.typeArguments; | 484 TypeArgumentList typeArgs = type.typeArguments; |
| 480 if (typeArgs != null) { | 485 if (typeArgs != null) { |
| 481 //TODO (danrubel) include type arguments | 486 //TODO (danrubel) include type arguments |
| 482 } | 487 } |
| 483 return name; | 488 return name; |
| 484 } | 489 } |
| 485 } | 490 } |
| OLD | NEW |