| 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.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 16 matching lines...) Expand all Loading... |
| 27 void declaredClass(ClassDeclaration declaration); | 27 void declaredClass(ClassDeclaration declaration); |
| 28 | 28 |
| 29 void declaredClassTypeAlias(ClassTypeAlias declaration); | 29 void declaredClassTypeAlias(ClassTypeAlias declaration); |
| 30 | 30 |
| 31 void declaredField(FieldDeclaration fieldDecl, VariableDeclaration varDecl); | 31 void declaredField(FieldDeclaration fieldDecl, VariableDeclaration varDecl); |
| 32 | 32 |
| 33 void declaredFunction(FunctionDeclaration declaration); | 33 void declaredFunction(FunctionDeclaration declaration); |
| 34 | 34 |
| 35 void declaredFunctionTypeAlias(FunctionTypeAlias declaration); | 35 void declaredFunctionTypeAlias(FunctionTypeAlias declaration); |
| 36 | 36 |
| 37 void declaredLabel(Label label); | 37 void declaredLabel(Label label, bool isCaseLabel); |
| 38 | 38 |
| 39 void declaredLocalVar(SimpleIdentifier name, TypeName type); | 39 void declaredLocalVar(SimpleIdentifier name, TypeName type); |
| 40 | 40 |
| 41 void declaredMethod(MethodDeclaration declaration); | 41 void declaredMethod(MethodDeclaration declaration); |
| 42 | 42 |
| 43 void declaredParam(SimpleIdentifier name, TypeName type); | 43 void declaredParam(SimpleIdentifier name, TypeName type); |
| 44 | 44 |
| 45 void declaredTopLevelVar(VariableDeclarationList varList, | 45 void declaredTopLevelVar(VariableDeclarationList varList, |
| 46 VariableDeclaration varDecl); | 46 VariableDeclaration varDecl); |
| 47 | 47 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 _visitParamList(node.parameters); | 174 _visitParamList(node.parameters); |
| 175 return visitNode(node); | 175 return visitNode(node); |
| 176 } | 176 } |
| 177 | 177 |
| 178 @override | 178 @override |
| 179 bool visitInterpolationExpression(InterpolationExpression node) { | 179 bool visitInterpolationExpression(InterpolationExpression node) { |
| 180 return visitNode(node); | 180 return visitNode(node); |
| 181 } | 181 } |
| 182 | 182 |
| 183 @override | 183 @override |
| 184 bool visitSwitchStatement(SwitchStatement node) { |
| 185 for (SwitchMember member in node.members) { |
| 186 for (Label label in member.labels) { |
| 187 declaredLabel(label, true); |
| 188 } |
| 189 } |
| 190 return visitNode(node); |
| 191 } |
| 192 |
| 193 @override |
| 184 bool visitLabeledStatement(LabeledStatement node) { | 194 bool visitLabeledStatement(LabeledStatement node) { |
| 185 node.labels.forEach(declaredLabel); | 195 for (Label label in node.labels) { |
| 196 declaredLabel(label, false); |
| 197 } |
| 186 return visitNode(node); | 198 return visitNode(node); |
| 187 } | 199 } |
| 188 | 200 |
| 189 @override | 201 @override |
| 190 bool visitMethodDeclaration(MethodDeclaration node) { | 202 bool visitMethodDeclaration(MethodDeclaration node) { |
| 191 _visitParamList(node.parameters); | 203 _visitParamList(node.parameters); |
| 192 return visitNode(node); | 204 return visitNode(node); |
| 193 } | 205 } |
| 194 | 206 |
| 195 @override | 207 @override |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 type = normalParam.returnType; | 245 type = normalParam.returnType; |
| 234 } else if (normalParam is SimpleFormalParameter) { | 246 } else if (normalParam is SimpleFormalParameter) { |
| 235 type = normalParam.type; | 247 type = normalParam.type; |
| 236 } | 248 } |
| 237 SimpleIdentifier name = param.identifier; | 249 SimpleIdentifier name = param.identifier; |
| 238 declaredParam(name, type); | 250 declaredParam(name, type); |
| 239 }); | 251 }); |
| 240 } | 252 } |
| 241 } | 253 } |
| 242 } | 254 } |
| OLD | NEW |