| 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/dart/element/type.dart'; | 9 import 'package:analyzer/dart/element/type.dart'; |
| 10 import 'package:analyzer/src/dart/element/member.dart'; | 10 import 'package:analyzer/src/dart/element/member.dart'; |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 visitIndexExpression(IndexExpression node) { | 497 visitIndexExpression(IndexExpression node) { |
| 498 MethodElement element = node.bestElement; | 498 MethodElement element = node.bestElement; |
| 499 if (element is MethodElement) { | 499 if (element is MethodElement) { |
| 500 Token operator = node.leftBracket; | 500 Token operator = node.leftBracket; |
| 501 recordRelationToken(element, IndexRelationKind.IS_INVOKED_BY, operator); | 501 recordRelationToken(element, IndexRelationKind.IS_INVOKED_BY, operator); |
| 502 } | 502 } |
| 503 super.visitIndexExpression(node); | 503 super.visitIndexExpression(node); |
| 504 } | 504 } |
| 505 | 505 |
| 506 @override | 506 @override |
| 507 visitLibraryIdentifier(LibraryIdentifier node) {} |
| 508 |
| 509 @override |
| 507 visitMethodInvocation(MethodInvocation node) { | 510 visitMethodInvocation(MethodInvocation node) { |
| 508 SimpleIdentifier name = node.methodName; | 511 SimpleIdentifier name = node.methodName; |
| 509 Element element = name.bestElement; | 512 Element element = name.bestElement; |
| 510 // unresolved name invocation | 513 // unresolved name invocation |
| 511 bool isQualified = node.realTarget != null; | 514 bool isQualified = node.realTarget != null; |
| 512 if (element == null) { | 515 if (element == null) { |
| 513 recordNameRelation(name, IndexRelationKind.IS_INVOKED_BY, isQualified); | 516 recordNameRelation(name, IndexRelationKind.IS_INVOKED_BY, isQualified); |
| 514 } | 517 } |
| 515 // element invocation | 518 // element invocation |
| 516 IndexRelationKind kind = element is ClassElement | 519 IndexRelationKind kind = element is ClassElement |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 usedNameOffsets: nameRelations.map((r) => r.offset).toList(), | 800 usedNameOffsets: nameRelations.map((r) => r.offset).toList(), |
| 798 usedNameIsQualifiedFlags: | 801 usedNameIsQualifiedFlags: |
| 799 nameRelations.map((r) => r.isQualified).toList()); | 802 nameRelations.map((r) => r.isQualified).toList()); |
| 800 } | 803 } |
| 801 | 804 |
| 802 void defineName(String name, IndexNameKind kind, int offset) { | 805 void defineName(String name, IndexNameKind kind, int offset) { |
| 803 _StringInfo nameInfo = pkg._getStringInfo(name); | 806 _StringInfo nameInfo = pkg._getStringInfo(name); |
| 804 definedNames.add(new _DefinedNameInfo(nameInfo, kind, offset)); | 807 definedNames.add(new _DefinedNameInfo(nameInfo, kind, offset)); |
| 805 } | 808 } |
| 806 } | 809 } |
| OLD | NEW |