| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |