| 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.dart.local.declaration.visitor; | 5 library services.completion.dart.local.declaration.visitor; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
| 8 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/ast/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| 10 import 'package:analyzer/src/dart/ast/token.dart'; | 11 import 'package:analyzer/src/dart/ast/token.dart'; |
| 11 | 12 |
| 12 /** | 13 /** |
| 13 * `LocalDeclarationCollector` visits an [AstNode] and its parent recursively | 14 * `LocalDeclarationCollector` visits an [AstNode] and its parent recursively |
| 14 * along with any declarations in those nodes. Consumers typically call [visit] | 15 * along with any declarations in those nodes. Consumers typically call [visit] |
| 15 * which catches the exception thrown by [finished()]. | 16 * which catches the exception thrown by [finished()]. |
| 16 */ | 17 */ |
| 17 abstract class LocalDeclarationVisitor extends GeneralizingAstVisitor { | 18 abstract class LocalDeclarationVisitor extends GeneralizingAstVisitor { |
| 18 static final TypeName STACKTRACE_TYPE = new TypeName( | 19 static final TypeName STACKTRACE_TYPE = astFactory.typeName( |
| 19 new SimpleIdentifier( | 20 astFactory.simpleIdentifier( |
| 20 new StringToken(TokenType.IDENTIFIER, 'StackTrace', 0)), | 21 new StringToken(TokenType.IDENTIFIER, 'StackTrace', 0)), |
| 21 null); | 22 null); |
| 22 | 23 |
| 23 final int offset; | 24 final int offset; |
| 24 | 25 |
| 25 LocalDeclarationVisitor(this.offset); | 26 LocalDeclarationVisitor(this.offset); |
| 26 | 27 |
| 27 void declaredClass(ClassDeclaration declaration); | 28 void declaredClass(ClassDeclaration declaration); |
| 28 | 29 |
| 29 void declaredClassTypeAlias(ClassTypeAlias declaration); | 30 void declaredClassTypeAlias(ClassTypeAlias declaration); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 274 } |
| 274 } | 275 } |
| 275 } | 276 } |
| 276 } | 277 } |
| 277 | 278 |
| 278 /** | 279 /** |
| 279 * Internal exception used to indicate that [LocalDeclarationVisitor] | 280 * Internal exception used to indicate that [LocalDeclarationVisitor] |
| 280 * should stop visiting. | 281 * should stop visiting. |
| 281 */ | 282 */ |
| 282 class _LocalDeclarationVisitorFinished {} | 283 class _LocalDeclarationVisitorFinished {} |
| OLD | NEW |