| 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.invocation; | 5 library services.completion.computer.dart.invocation; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 9 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 10 import 'package:analysis_server/src/services/completion/optype.dart'; | 10 import 'package:analysis_server/src/services/completion/optype.dart'; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 @override | 56 @override |
| 57 Future<bool> computeFull(AstNode node) { | 57 Future<bool> computeFull(AstNode node) { |
| 58 if (node is SimpleIdentifier) { | 58 if (node is SimpleIdentifier) { |
| 59 node = node.parent; | 59 node = node.parent; |
| 60 } | 60 } |
| 61 if (node is MethodInvocation) { | 61 if (node is MethodInvocation) { |
| 62 node = (node as MethodInvocation).realTarget; | 62 node = (node as MethodInvocation).realTarget; |
| 63 } else if (node is PropertyAccess) { | 63 } else if (node is PropertyAccess) { |
| 64 node = (node as PropertyAccess).realTarget; | 64 node = (node as PropertyAccess).realTarget; |
| 65 } | 65 } |
| 66 if (node is Identifier && node.bestElement is ClassElement) { |
| 67 node.bestElement.accept( |
| 68 new _PrefixedIdentifierSuggestionBuilder(request)); |
| 69 return new Future.value(true); |
| 70 } |
| 66 if (node is Expression) { | 71 if (node is Expression) { |
| 67 InterfaceTypeSuggestionBuilder.suggestionsFor(request, node.bestType); | 72 InterfaceTypeSuggestionBuilder.suggestionsFor(request, node.bestType); |
| 68 return new Future.value(true); | 73 return new Future.value(true); |
| 69 } | 74 } |
| 70 return new Future.value(false); | 75 return new Future.value(false); |
| 71 } | 76 } |
| 72 } | 77 } |
| 73 | 78 |
| 74 /** | 79 /** |
| 75 * An [AstNode] vistor for determining which suggestion builder | 80 * An [AstNode] vistor for determining which suggestion builder |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 217 } |
| 213 return new Future.value(false); | 218 return new Future.value(false); |
| 214 } | 219 } |
| 215 | 220 |
| 216 @override | 221 @override |
| 217 Future<bool> visitVariableElement(VariableElement element) { | 222 Future<bool> visitVariableElement(VariableElement element) { |
| 218 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type); | 223 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type); |
| 219 return new Future.value(true); | 224 return new Future.value(true); |
| 220 } | 225 } |
| 221 } | 226 } |
| OLD | NEW |