Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: pkg/analysis_server/lib/src/services/index/index_contributor.dart

Issue 783223003: Issue 21801. Index redirecting constructor invocations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/index/dart_index_contributor_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 return super.visitPostfixExpression(node); 655 return super.visitPostfixExpression(node);
656 } 656 }
657 657
658 @override 658 @override
659 Object visitPrefixExpression(PrefixExpression node) { 659 Object visitPrefixExpression(PrefixExpression node) {
660 _recordOperatorReference(node.operator, node.bestElement); 660 _recordOperatorReference(node.operator, node.bestElement);
661 return super.visitPrefixExpression(node); 661 return super.visitPrefixExpression(node);
662 } 662 }
663 663
664 @override 664 @override
665 Object
666 visitRedirectingConstructorInvocation(RedirectingConstructorInvocation nod e) {
667 ConstructorElement element = node.staticElement;
668 Location location;
669 if (node.constructorName != null) {
670 int start = node.period.offset;
671 int end = node.constructorName.end;
672 location = _createLocationForOffset(start, end - start);
673 } else {
674 int start = node.keyword.end;
675 location = _createLocationForOffset(start, 0);
676 }
677 recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
678 return super.visitRedirectingConstructorInvocation(node);
679 }
680
681 @override
665 Object visitSimpleIdentifier(SimpleIdentifier node) { 682 Object visitSimpleIdentifier(SimpleIdentifier node) {
666 Element nameElement = new NameElement(node.name); 683 Element nameElement = new NameElement(node.name);
667 Location location = _createLocationForNode(node); 684 Location location = _createLocationForNode(node);
668 // name in declaration 685 // name in declaration
669 if (node.inDeclarationContext()) { 686 if (node.inDeclarationContext()) {
670 recordRelationship( 687 recordRelationship(
671 nameElement, 688 nameElement,
672 IndexConstants.NAME_IS_DEFINED_BY, 689 IndexConstants.NAME_IS_DEFINED_BY,
673 location); 690 location);
674 return null; 691 return null;
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 } 1062 }
1046 1063
1047 /** 1064 /**
1048 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node ". 1065 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node ".
1049 */ 1066 */
1050 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { 1067 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) {
1051 AstNode parent = node.parent; 1068 AstNode parent = node.parent;
1052 return parent is PrefixedIdentifier && parent.identifier == node; 1069 return parent is PrefixedIdentifier && parent.identifier == node;
1053 } 1070 }
1054 } 1071 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/index/dart_index_contributor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698