| 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 computer.navigation; | 5 library computer.navigation; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/constants.dart'; | 7 import 'package:analysis_server/src/constants.dart'; |
| 8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
| 9 import 'package:analyzer/src/generated/element.dart'; | 9 import 'package:analyzer/src/generated/element.dart'; |
| 10 import 'package:analyzer/src/generated/scanner.dart'; | 10 import 'package:analyzer/src/generated/scanner.dart'; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 | 71 |
| 72 void _addRegion_tokenStart_nodeEnd(Token a, AstNode b, Element element) { | 72 void _addRegion_tokenStart_nodeEnd(Token a, AstNode b, Element element) { |
| 73 int offset = a.offset; | 73 int offset = a.offset; |
| 74 int length = b.end - offset; | 74 int length = b.end - offset; |
| 75 _addRegion(offset, length, element); | 75 _addRegion(offset, length, element); |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| 79 | 79 |
| 80 | |
| 81 class _DartUnitNavigationComputerVisitor extends RecursiveAstVisitor { | 80 class _DartUnitNavigationComputerVisitor extends RecursiveAstVisitor { |
| 82 final DartUnitNavigationComputer computer; | 81 final DartUnitNavigationComputer computer; |
| 83 | 82 |
| 84 _DartUnitNavigationComputerVisitor(this.computer); | 83 _DartUnitNavigationComputerVisitor(this.computer); |
| 85 | 84 |
| 86 @override | 85 @override |
| 87 visitAssignmentExpression(AssignmentExpression node) { | 86 visitAssignmentExpression(AssignmentExpression node) { |
| 88 computer._addRegionForToken(node.operator, node.bestElement); | 87 computer._addRegionForToken(node.operator, node.bestElement); |
| 89 return super.visitAssignmentExpression(node); | 88 return super.visitAssignmentExpression(node); |
| 90 } | 89 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 175 |
| 177 @override | 176 @override |
| 178 visitSimpleIdentifier(SimpleIdentifier node) { | 177 visitSimpleIdentifier(SimpleIdentifier node) { |
| 179 if (node.parent is ConstructorDeclaration) { | 178 if (node.parent is ConstructorDeclaration) { |
| 180 } else { | 179 } else { |
| 181 computer._addRegionForNode(node, node.bestElement); | 180 computer._addRegionForNode(node, node.bestElement); |
| 182 } | 181 } |
| 183 return super.visitSimpleIdentifier(node); | 182 return super.visitSimpleIdentifier(node); |
| 184 } | 183 } |
| 185 } | 184 } |
| OLD | NEW |