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

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

Issue 683133003: suggest imported functions in argument 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 30 matching lines...) Expand all
41 /** 41 /**
42 * A visitor for determining which imported class and top level variable 42 * A visitor for determining which imported class and top level variable
43 * should be suggested and building those suggestions. 43 * should be suggested and building those suggestions.
44 */ 44 */
45 class _ImportedVisitor extends GeneralizingAstVisitor<Future<bool>> { 45 class _ImportedVisitor extends GeneralizingAstVisitor<Future<bool>> {
46 final DartCompletionRequest request; 46 final DartCompletionRequest request;
47 47
48 _ImportedVisitor(this.request); 48 _ImportedVisitor(this.request);
49 49
50 @override 50 @override
51 Future<bool> visitArgumentList(ArgumentList node) {
52 return _addImportedElementSuggestions(node, excludeVoidReturn: true);
53 }
54
55 @override
51 Future<bool> visitBlock(Block node) { 56 Future<bool> visitBlock(Block node) {
52 return _addImportedElementSuggestions(node); 57 return _addImportedElementSuggestions(node);
53 } 58 }
54 59
55 @override 60 @override
56 Future<bool> visitCascadeExpression(CascadeExpression node) { 61 Future<bool> visitCascadeExpression(CascadeExpression node) {
57 // Make suggestions for the target, but not for the selector 62 // Make suggestions for the target, but not for the selector
58 // InvocationComputer makes selector suggestions 63 // InvocationComputer makes selector suggestions
59 Expression target = node.target; 64 Expression target = node.target;
60 if (target != null && request.offset <= target.end) { 65 if (target != null && request.offset <= target.end) {
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 importElem.isDeprecated, 389 importElem.isDeprecated,
385 false); 390 false);
386 LibraryElement lib = importElem.importedLibrary; 391 LibraryElement lib = importElem.importedLibrary;
387 if (lib != null) { 392 if (lib != null) {
388 suggestion.element = newElement_fromEngine(lib); 393 suggestion.element = newElement_fromEngine(lib);
389 } 394 }
390 request.suggestions.add(suggestion); 395 request.suggestions.add(suggestion);
391 } 396 }
392 } 397 }
393 } 398 }
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