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

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

Issue 693573003: add suggestions in format parameter list (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 Expression expression = node.expression; 93 Expression expression = node.expression;
94 // A pre-variable declaration (e.g. C ^) is parsed as an expression 94 // A pre-variable declaration (e.g. C ^) is parsed as an expression
95 // statement. Do not make suggestions for the variable name. 95 // statement. Do not make suggestions for the variable name.
96 if (expression is SimpleIdentifier && request.offset <= expression.end) { 96 if (expression is SimpleIdentifier && request.offset <= expression.end) {
97 return _addImportedElementSuggestions(node); 97 return _addImportedElementSuggestions(node);
98 } 98 }
99 return new Future.value(false); 99 return new Future.value(false);
100 } 100 }
101 101
102 @override 102 @override
103 Future<bool> visitFormalParameterList(FormalParameterList node) {
104 Token leftParen = node.leftParenthesis;
105 if (leftParen != null && request.offset > leftParen.offset) {
106 Token rightParen = node.rightParenthesis;
107 if (rightParen == null || request.offset <= rightParen.offset) {
108 return _addImportedElementSuggestions(node);
109 }
110 }
111 return new Future.value(false);
112 }
113
114 @override
103 Future<bool> visitForStatement(ForStatement node) { 115 Future<bool> visitForStatement(ForStatement node) {
104 Token leftParenthesis = node.leftParenthesis; 116 Token leftParen = node.leftParenthesis;
105 if (leftParenthesis != null && request.offset >= leftParenthesis.end) { 117 if (leftParen != null && request.offset >= leftParen.end) {
106 return _addImportedElementSuggestions(node); 118 return _addImportedElementSuggestions(node);
107 } 119 }
108 return new Future.value(false); 120 return new Future.value(false);
109 } 121 }
110 122
111 @override 123 @override
112 Future<bool> visitIfStatement(IfStatement node) { 124 Future<bool> visitIfStatement(IfStatement node) {
113 Token leftParen = node.leftParenthesis; 125 Token leftParen = node.leftParenthesis;
114 if (leftParen != null && request.offset >= leftParen.end) { 126 if (leftParen != null && request.offset >= leftParen.end) {
115 Token rightParen = node.rightParenthesis; 127 Token rightParen = node.rightParenthesis;
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 importElem.isDeprecated, 400 importElem.isDeprecated,
389 false); 401 false);
390 LibraryElement lib = importElem.importedLibrary; 402 LibraryElement lib = importElem.importedLibrary;
391 if (lib != null) { 403 if (lib != null) {
392 suggestion.element = newElement_fromEngine(lib); 404 suggestion.element = newElement_fromEngine(lib);
393 } 405 }
394 request.suggestions.add(suggestion); 406 request.suggestions.add(suggestion);
395 } 407 }
396 } 408 }
397 } 409 }
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