| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 node = node.parent; | 142 node = node.parent; |
| 143 } | 143 } |
| 144 if (node is ConstructorName) { | 144 if (node is ConstructorName) { |
| 145 // some PrefixedIdentifier nodes are transformed into | 145 // some PrefixedIdentifier nodes are transformed into |
| 146 // ConstructorName nodes during the resolution process. | 146 // ConstructorName nodes during the resolution process. |
| 147 return new NamedConstructorSuggestionBuilder(request).computeFull(node); | 147 return new NamedConstructorSuggestionBuilder(request).computeFull(node); |
| 148 } | 148 } |
| 149 if (node is PrefixedIdentifier) { | 149 if (node is PrefixedIdentifier) { |
| 150 SimpleIdentifier prefix = node.prefix; | 150 SimpleIdentifier prefix = node.prefix; |
| 151 if (prefix != null) { | 151 if (prefix != null) { |
| 152 if (prefix.propagatedType != null) { | 152 Element element = prefix.bestElement; |
| 153 DartType type = prefix.bestType; |
| 154 if (element is! ClassElement && type != null && !type.isDynamic) { |
| 153 InterfaceTypeSuggestionBuilder.suggestionsFor( | 155 InterfaceTypeSuggestionBuilder.suggestionsFor( |
| 154 request, | 156 request, |
| 155 prefix.propagatedType); | 157 type); |
| 156 } else { | 158 return new Future.value(true); |
| 157 Element element = prefix.bestElement; | 159 } else if (element != null) { |
| 158 if (element != null) { | 160 return element.accept(this); |
| 159 return element.accept(this); | |
| 160 } | |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 return new Future.value(false); | 164 return new Future.value(false); |
| 165 } | 165 } |
| 166 | 166 |
| 167 @override | 167 @override |
| 168 Future<bool> visitClassElement(ClassElement element) { | 168 Future<bool> visitClassElement(ClassElement element) { |
| 169 if (element != null) { | 169 if (element != null) { |
| 170 InterfaceType type = element.type; | 170 InterfaceType type = element.type; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 217 } |
| 218 return new Future.value(false); | 218 return new Future.value(false); |
| 219 } | 219 } |
| 220 | 220 |
| 221 @override | 221 @override |
| 222 Future<bool> visitVariableElement(VariableElement element) { | 222 Future<bool> visitVariableElement(VariableElement element) { |
| 223 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type); | 223 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type); |
| 224 return new Future.value(true); | 224 return new Future.value(true); |
| 225 } | 225 } |
| 226 } | 226 } |
| OLD | NEW |