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

Side by Side Diff: pkg/analyzer/lib/src/summary/index_unit.dart

Issue 1761073004: Don't index constructor element reference second time. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/index_unit_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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'package:analyzer/dart/ast/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/dart/ast/token.dart'; 6 import 'package:analyzer/dart/ast/token.dart';
7 import 'package:analyzer/dart/ast/visitor.dart'; 7 import 'package:analyzer/dart/ast/visitor.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/src/dart/element/member.dart'; 9 import 'package:analyzer/src/dart/element/member.dart';
10 import 'package:analyzer/src/generated/utilities_dart.dart'; 10 import 'package:analyzer/src/generated/utilities_dart.dart';
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 if (node.name != null) { 399 if (node.name != null) {
400 int offset = node.period.offset; 400 int offset = node.period.offset;
401 int length = node.name.end - offset; 401 int length = node.name.end - offset;
402 recordRelationOffset( 402 recordRelationOffset(
403 element, IndexRelationKind.IS_REFERENCED_BY, offset, length, true); 403 element, IndexRelationKind.IS_REFERENCED_BY, offset, length, true);
404 } else { 404 } else {
405 int offset = node.type.end; 405 int offset = node.type.end;
406 recordRelationOffset( 406 recordRelationOffset(
407 element, IndexRelationKind.IS_REFERENCED_BY, offset, 0, true); 407 element, IndexRelationKind.IS_REFERENCED_BY, offset, 0, true);
408 } 408 }
409 super.visitConstructorName(node); 409 node.type.accept(this);
410 } 410 }
411 411
412 @override 412 @override
413 visitExportDirective(ExportDirective node) { 413 visitExportDirective(ExportDirective node) {
414 ExportElement element = node.element; 414 ExportElement element = node.element;
415 recordUriReference(element?.exportedLibrary, node); 415 recordUriReference(element?.exportedLibrary, node);
416 super.visitExportDirective(node); 416 super.visitExportDirective(node);
417 } 417 }
418 418
419 @override 419 @override
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 usedNames: nameRelations.map((r) => r.nameId).toList(), 667 usedNames: nameRelations.map((r) => r.nameId).toList(),
668 usedNameKinds: nameRelations.map((r) => r.kind).toList(), 668 usedNameKinds: nameRelations.map((r) => r.kind).toList(),
669 usedNameOffsets: nameRelations.map((r) => r.offset).toList()); 669 usedNameOffsets: nameRelations.map((r) => r.offset).toList());
670 } 670 }
671 671
672 void defineName(String name, IndexNameKind kind, int offset) { 672 void defineName(String name, IndexNameKind kind, int offset) {
673 int nameId = pkg._getStringId(name); 673 int nameId = pkg._getStringId(name);
674 definedNames.add(new _DefinedNameInfo(nameId, kind, offset)); 674 definedNames.add(new _DefinedNameInfo(nameId, kind, offset));
675 } 675 }
676 } 676 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/index_unit_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698