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

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

Issue 902983002: use propogated type for completions (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/completion_test.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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 node = node.parent; 137 node = node.parent;
138 } 138 }
139 if (node is ConstructorName) { 139 if (node is ConstructorName) {
140 // some PrefixedIdentifier nodes are transformed into 140 // some PrefixedIdentifier nodes are transformed into
141 // ConstructorName nodes during the resolution process. 141 // ConstructorName nodes during the resolution process.
142 return new NamedConstructorSuggestionBuilder(request).computeFull(node); 142 return new NamedConstructorSuggestionBuilder(request).computeFull(node);
143 } 143 }
144 if (node is PrefixedIdentifier) { 144 if (node is PrefixedIdentifier) {
145 SimpleIdentifier prefix = node.prefix; 145 SimpleIdentifier prefix = node.prefix;
146 if (prefix != null) { 146 if (prefix != null) {
147 Element element = prefix.bestElement; 147 if (prefix.propagatedType != null) {
148 if (element != null) { 148 InterfaceTypeSuggestionBuilder.suggestionsFor(
149 return element.accept(this); 149 request,
150 prefix.propagatedType);
151 } else {
152 Element element = prefix.bestElement;
153 if (element != null) {
154 return element.accept(this);
155 }
150 } 156 }
151 } 157 }
152 } 158 }
153 return new Future.value(false); 159 return new Future.value(false);
154 } 160 }
155 161
156 @override 162 @override
157 Future<bool> visitClassElement(ClassElement element) { 163 Future<bool> visitClassElement(ClassElement element) {
158 if (element != null) { 164 if (element != null) {
159 InterfaceType type = element.type; 165 InterfaceType type = element.type;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 212 }
207 return new Future.value(false); 213 return new Future.value(false);
208 } 214 }
209 215
210 @override 216 @override
211 Future<bool> visitVariableElement(VariableElement element) { 217 Future<bool> visitVariableElement(VariableElement element) {
212 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type); 218 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type);
213 return new Future.value(true); 219 return new Future.value(true);
214 } 220 }
215 } 221 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/completion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698