OLD | NEW |
---|---|
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.contributor.dart.keyword; | 5 library services.completion.contributor.dart.keyword; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/protocol.dart'; | 9 import 'package:analysis_server/src/protocol.dart'; |
10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; | 10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 _addCompilationUnitKeywords(); | 143 _addCompilationUnitKeywords(); |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 @override | 147 @override |
148 visitExpression(Expression node) { | 148 visitExpression(Expression node) { |
149 _addExpressionKeywords(node); | 149 _addExpressionKeywords(node); |
150 } | 150 } |
151 | 151 |
152 @override | 152 @override |
153 visitInstanceCreationExpression(InstanceCreationExpression node) { | |
Paul Berry
2015/05/29 16:00:47
Do similar cases need to be added for visitPropert
danrubel
2015/05/29 17:26:41
Good point. Will address in subsequent CL.
danrubel
2015/06/06 15:32:20
https://codereview.chromium.org/1151493004/
| |
154 if (entity == node.constructorName) { | |
155 // no keywords in 'new ^' expression | |
156 } else { | |
157 super.visitInstanceCreationExpression(node); | |
158 } | |
159 } | |
160 | |
161 @override | |
162 visitMethodInvocation(MethodInvocation node) { | |
163 if (entity == node.methodName) { | |
164 // no keywords in '.' expression | |
165 } else { | |
166 super.visitMethodInvocation(node); | |
167 } | |
168 } | |
169 | |
170 @override | |
153 visitExpressionFunctionBody(ExpressionFunctionBody node) { | 171 visitExpressionFunctionBody(ExpressionFunctionBody node) { |
154 if (entity == node.expression) { | 172 if (entity == node.expression) { |
155 _addExpressionKeywords(node); | 173 _addExpressionKeywords(node); |
156 } | 174 } |
157 } | 175 } |
158 | 176 |
159 @override | 177 @override |
160 visitFormalParameterList(FormalParameterList node) { | 178 visitFormalParameterList(FormalParameterList node) { |
161 AstNode constructorDecl = | 179 AstNode constructorDecl = |
162 node.getAncestor((p) => p is ConstructorDeclaration); | 180 node.getAncestor((p) => p is ConstructorDeclaration); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 return false; | 408 return false; |
391 } | 409 } |
392 AstNode parent = body.parent; | 410 AstNode parent = body.parent; |
393 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { | 411 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { |
394 return true; | 412 return true; |
395 } | 413 } |
396 node = parent; | 414 node = parent; |
397 } | 415 } |
398 } | 416 } |
399 } | 417 } |
OLD | NEW |