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

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

Issue 646773002: include imported elements in interpolation suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/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.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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 @override 97 @override
98 Future<bool> visitForStatement(ForStatement node) { 98 Future<bool> visitForStatement(ForStatement node) {
99 Token leftParenthesis = node.leftParenthesis; 99 Token leftParenthesis = node.leftParenthesis;
100 if (leftParenthesis != null && request.offset >= leftParenthesis.end) { 100 if (leftParenthesis != null && request.offset >= leftParenthesis.end) {
101 return _addImportedElementSuggestions(); 101 return _addImportedElementSuggestions();
102 } 102 }
103 return new Future.value(false); 103 return new Future.value(false);
104 } 104 }
105 105
106 @override 106 @override
107 Future<bool> visitInterpolationExpression(InterpolationExpression node) {
108 Expression expression = node.expression;
109 if (expression is SimpleIdentifier) {
110 return _addImportedElementSuggestions();
111 }
112 return new Future.value(false);
113 }
114
115 @override
107 Future<bool> visitNode(AstNode node) { 116 Future<bool> visitNode(AstNode node) {
108 return new Future.value(false); 117 return new Future.value(false);
109 } 118 }
110 119
111 @override 120 @override
112 Future<bool> visitPrefixedIdentifier(PrefixedIdentifier node) { 121 Future<bool> visitPrefixedIdentifier(PrefixedIdentifier node) {
113 // Make suggestions for the prefix, but not for the selector 122 // Make suggestions for the prefix, but not for the selector
114 // InvocationComputer makes selector suggestions 123 // InvocationComputer makes selector suggestions
115 Token period = node.period; 124 Token period = node.period;
116 if (period != null && request.offset <= period.offset) { 125 if (period != null && request.offset <= period.offset) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 importElem.isDeprecated, 285 importElem.isDeprecated,
277 false); 286 false);
278 LibraryElement lib = importElem.importedLibrary; 287 LibraryElement lib = importElem.importedLibrary;
279 if (lib != null) { 288 if (lib != null) {
280 suggestion.element = newElement_fromEngine(lib); 289 suggestion.element = newElement_fromEngine(lib);
281 } 290 }
282 request.suggestions.add(suggestion); 291 request.suggestions.add(suggestion);
283 } 292 }
284 } 293 }
285 } 294 }
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