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

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

Issue 632323002: local cascade suggestion fix and move towards 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/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.local; 5 library services.completion.computer.dart.local;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, Ele mentKind; 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, Ele mentKind;
10 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; 10 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 _addParamListSuggestions(node.parameters); 197 _addParamListSuggestions(node.parameters);
198 visitNode(node); 198 visitNode(node);
199 } 199 }
200 200
201 @override 201 @override
202 visitNode(AstNode node) { 202 visitNode(AstNode node) {
203 node.parent.accept(this); 203 node.parent.accept(this);
204 } 204 }
205 205
206 @override 206 @override
207 visitCascadeExpression(CascadeExpression node) {
208 Expression target = node.target;
209 // This computer handles the expression
210 // while InvocationComputer handles the cascade selector
211 if (target != null && request.offset <= target.end) {
212 visitNode(node);
213 }
214 }
215
216 @override
207 visitVariableDeclaration(VariableDeclaration node) { 217 visitVariableDeclaration(VariableDeclaration node) {
208 // Do not add suggestions if editing the name in a var declaration 218 // Do not add suggestions if editing the name in a var declaration
209 SimpleIdentifier name = node.name; 219 SimpleIdentifier name = node.name;
210 if (name == null || 220 if (name == null ||
211 name.offset < request.offset || 221 name.offset < request.offset ||
212 request.offset > name.end) { 222 request.offset > name.end) {
213 visitNode(node); 223 visitNode(node);
214 } 224 }
215 } 225 }
216 226
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 if (name == null || name.length <= 0) { 443 if (name == null || name.length <= 0) {
434 return DYNAMIC; 444 return DYNAMIC;
435 } 445 }
436 TypeArgumentList typeArgs = type.typeArguments; 446 TypeArgumentList typeArgs = type.typeArguments;
437 if (typeArgs != null) { 447 if (typeArgs != null) {
438 //TODO (danrubel) include type arguments 448 //TODO (danrubel) include type arguments
439 } 449 }
440 return name; 450 return name;
441 } 451 }
442 } 452 }
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