Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Side by Side Diff: pkg/analysis_server/lib/src/services/completion/invocation_computer.dart

Issue 929323002: fix code completion invocation on getter (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698