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

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

Issue 645573004: fix suggestions in class body and more common tests (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/local_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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Make suggestions for the target, but not for the selector 57 // Make suggestions for the target, but not for the selector
58 // InvocationComputer makes selector suggestions 58 // InvocationComputer makes selector suggestions
59 Expression target = node.target; 59 Expression target = node.target;
60 if (target != null && request.offset <= target.end) { 60 if (target != null && request.offset <= target.end) {
61 return _addImportedElementSuggestions(); 61 return _addImportedElementSuggestions();
62 } 62 }
63 return new Future.value(false); 63 return new Future.value(false);
64 } 64 }
65 65
66 @override 66 @override
67 Future<bool> visitClassDeclaration(ClassDeclaration node) {
68 // Make suggestions in the body of the class declaration
69 Token leftBracket = node.leftBracket;
70 if (leftBracket != null && request.offset >= leftBracket.end) {
71 return _addImportedElementSuggestions();
72 }
73 return new Future.value(false);
74 }
75
76 @override
67 Future<bool> visitCombinator(Combinator node) { 77 Future<bool> visitCombinator(Combinator node) {
68 return _addCombinatorSuggestions(node); 78 return _addCombinatorSuggestions(node);
69 } 79 }
70 80
71 @override 81 @override
72 Future<bool> visitExpression(Expression node) { 82 Future<bool> visitExpression(Expression node) {
73 return _addImportedElementSuggestions(); 83 return _addImportedElementSuggestions();
74 } 84 }
75 85
76 @override 86 @override
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 importElem.isDeprecated, 267 importElem.isDeprecated,
258 false); 268 false);
259 LibraryElement lib = importElem.importedLibrary; 269 LibraryElement lib = importElem.importedLibrary;
260 if (lib != null) { 270 if (lib != null) {
261 suggestion.element = newElement_fromEngine(lib); 271 suggestion.element = newElement_fromEngine(lib);
262 } 272 }
263 request.suggestions.add(suggestion); 273 request.suggestions.add(suggestion);
264 } 274 }
265 } 275 }
266 } 276 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/local_computer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698