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

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

Issue 651953006: improve method invocation and string interpolation suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 2 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/lib/src/services/completion/invocation_computer.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.toplevel; 5 library services.completion.computer.dart.toplevel;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol_server.dart' hide Element, 9 import 'package:analysis_server/src/protocol_server.dart' hide Element,
10 ElementKind; 10 ElementKind;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 @override 118 @override
119 Future<bool> visitInterpolationExpression(InterpolationExpression node) { 119 Future<bool> visitInterpolationExpression(InterpolationExpression node) {
120 Expression expression = node.expression; 120 Expression expression = node.expression;
121 if (expression is SimpleIdentifier) { 121 if (expression is SimpleIdentifier) {
122 return _addImportedElementSuggestions(); 122 return _addImportedElementSuggestions();
123 } 123 }
124 return new Future.value(false); 124 return new Future.value(false);
125 } 125 }
126 126
127 @override 127 @override
128 Future<bool> visitMethodInvocation(MethodInvocation node) {
129 Token period = node.period;
130 if (period == null || request.offset <= period.offset) {
131 return _addImportedElementSuggestions();
132 }
133 return new Future.value(false);
134 }
135
136 @override
128 Future<bool> visitNode(AstNode node) { 137 Future<bool> visitNode(AstNode node) {
129 return new Future.value(false); 138 return new Future.value(false);
130 } 139 }
131 140
132 @override 141 @override
133 Future<bool> visitPrefixedIdentifier(PrefixedIdentifier node) { 142 Future<bool> visitPrefixedIdentifier(PrefixedIdentifier node) {
134 // Make suggestions for the prefix, but not for the selector 143 // Make suggestions for the prefix, but not for the selector
135 // InvocationComputer makes selector suggestions 144 // InvocationComputer makes selector suggestions
136 Token period = node.period; 145 Token period = node.period;
137 if (period != null && request.offset <= period.offset) { 146 if (period != null && request.offset <= period.offset) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 importElem.isDeprecated, 306 importElem.isDeprecated,
298 false); 307 false);
299 LibraryElement lib = importElem.importedLibrary; 308 LibraryElement lib = importElem.importedLibrary;
300 if (lib != null) { 309 if (lib != null) {
301 suggestion.element = newElement_fromEngine(lib); 310 suggestion.element = newElement_fromEngine(lib);
302 } 311 }
303 request.suggestions.add(suggestion); 312 request.suggestions.add(suggestion);
304 } 313 }
305 } 314 }
306 } 315 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/invocation_computer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698