| 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.src.index.index_contributor; | 5 library services.src.index.index_contributor; |
| 6 | 6 |
| 7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/services/correction/namespace.dart'; | 9 import 'package:analysis_server/src/services/correction/namespace.dart'; |
| 10 import 'package:analysis_server/src/services/index/index.dart'; | 10 import 'package:analysis_server/src/services/index/index.dart'; |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 417 |
| 418 @override | 418 @override |
| 419 visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) { | 419 visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) { |
| 420 ConstructorElement element = node.staticElement; | 420 ConstructorElement element = node.staticElement; |
| 421 Location location; | 421 Location location; |
| 422 if (node.constructorName != null) { | 422 if (node.constructorName != null) { |
| 423 int start = node.period.offset; | 423 int start = node.period.offset; |
| 424 int end = node.constructorName.end; | 424 int end = node.constructorName.end; |
| 425 location = _createLocationForOffset(start, end - start); | 425 location = _createLocationForOffset(start, end - start); |
| 426 } else { | 426 } else { |
| 427 int start = node.keyword.end; | 427 int start = node.thisKeyword.end; |
| 428 location = _createLocationForOffset(start, 0); | 428 location = _createLocationForOffset(start, 0); |
| 429 } | 429 } |
| 430 recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location); | 430 recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location); |
| 431 super.visitRedirectingConstructorInvocation(node); | 431 super.visitRedirectingConstructorInvocation(node); |
| 432 } | 432 } |
| 433 | 433 |
| 434 @override | 434 @override |
| 435 visitSimpleIdentifier(SimpleIdentifier node) { | 435 visitSimpleIdentifier(SimpleIdentifier node) { |
| 436 Element nameElement = new NameElement(node.name); | 436 Element nameElement = new NameElement(node.name); |
| 437 Location location = _createLocationForNode(node); | 437 Location location = _createLocationForNode(node); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 514 |
| 515 @override | 515 @override |
| 516 visitSuperConstructorInvocation(SuperConstructorInvocation node) { | 516 visitSuperConstructorInvocation(SuperConstructorInvocation node) { |
| 517 ConstructorElement element = node.staticElement; | 517 ConstructorElement element = node.staticElement; |
| 518 Location location; | 518 Location location; |
| 519 if (node.constructorName != null) { | 519 if (node.constructorName != null) { |
| 520 int start = node.period.offset; | 520 int start = node.period.offset; |
| 521 int end = node.constructorName.end; | 521 int end = node.constructorName.end; |
| 522 location = _createLocationForOffset(start, end - start); | 522 location = _createLocationForOffset(start, end - start); |
| 523 } else { | 523 } else { |
| 524 int start = node.keyword.end; | 524 int start = node.superKeyword.end; |
| 525 location = _createLocationForOffset(start, 0); | 525 location = _createLocationForOffset(start, 0); |
| 526 } | 526 } |
| 527 recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location); | 527 recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location); |
| 528 super.visitSuperConstructorInvocation(node); | 528 super.visitSuperConstructorInvocation(node); |
| 529 } | 529 } |
| 530 | 530 |
| 531 @override | 531 @override |
| 532 visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { | 532 visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { |
| 533 VariableDeclarationList variables = node.variables; | 533 VariableDeclarationList variables = node.variables; |
| 534 for (VariableDeclaration variableDeclaration in variables.variables) { | 534 for (VariableDeclaration variableDeclaration in variables.variables) { |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 } | 818 } |
| 819 | 819 |
| 820 /** | 820 /** |
| 821 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node
". | 821 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node
". |
| 822 */ | 822 */ |
| 823 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { | 823 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { |
| 824 AstNode parent = node.parent; | 824 AstNode parent = node.parent; |
| 825 return parent is PrefixedIdentifier && parent.identifier == node; | 825 return parent is PrefixedIdentifier && parent.identifier == node; |
| 826 } | 826 } |
| 827 } | 827 } |
| OLD | NEW |