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

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

Issue 902913002: fix completions in indexed expression (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/optype.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.Declaration.visitor; 5 library services.completion.computer.dart.local.Declaration.visitor;
6 6
7 import 'package:analysis_server/src/services/completion/suggestion_builder.dart' ; 7 import 'package:analysis_server/src/services/completion/suggestion_builder.dart' ;
8 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/scanner.dart'; 9 import 'package:analyzer/src/generated/scanner.dart';
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } else if (declaration is ClassTypeAlias) { 119 } else if (declaration is ClassTypeAlias) {
120 declaredClassTypeAlias(declaration); 120 declaredClassTypeAlias(declaration);
121 } else if (declaration is FunctionTypeAlias) { 121 } else if (declaration is FunctionTypeAlias) {
122 declaredFunctionTypeAlias(declaration); 122 declaredFunctionTypeAlias(declaration);
123 } 123 }
124 }); 124 });
125 return finished; 125 return finished;
126 } 126 }
127 127
128 @override 128 @override
129 bool visitExpressionStatement(ExpressionStatement node) {
130 Expression expression = node.expression;
131 if (expression is SimpleIdentifier) {
132 if (expression.end < offset) {
133 return finished;
134 }
135 }
136 return visitNode(node);
137 }
138
139 @override
140 bool visitForEachStatement(ForEachStatement node) { 129 bool visitForEachStatement(ForEachStatement node) {
141 SimpleIdentifier id; 130 SimpleIdentifier id;
142 TypeName type; 131 TypeName type;
143 DeclaredIdentifier loopVar = node.loopVariable; 132 DeclaredIdentifier loopVar = node.loopVariable;
144 if (loopVar != null) { 133 if (loopVar != null) {
145 id = loopVar.identifier; 134 id = loopVar.identifier;
146 type = loopVar.type; 135 type = loopVar.type;
147 } else { 136 } else {
148 id = node.identifier; 137 id = node.identifier;
149 type = null; 138 type = null;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 type = normalParam.returnType; 234 type = normalParam.returnType;
246 } else if (normalParam is SimpleFormalParameter) { 235 } else if (normalParam is SimpleFormalParameter) {
247 type = normalParam.type; 236 type = normalParam.type;
248 } 237 }
249 SimpleIdentifier name = param.identifier; 238 SimpleIdentifier name = param.identifier;
250 declaredParam(name, type); 239 declaredParam(name, type);
251 }); 240 });
252 } 241 }
253 } 242 }
254 } 243 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/optype.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698