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

Unified Diff: pkg/analyzer/lib/src/summary/index_unit.dart

Issue 1738213003: Use separate relation kinds for qualified usages. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/test/src/summary/index_unit_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/index_unit.dart
diff --git a/pkg/analyzer/lib/src/summary/index_unit.dart b/pkg/analyzer/lib/src/summary/index_unit.dart
index 752841ee76cf157d7697eaedc655af1b44de7dd9..b5de76652169b0c1a1aff2a473713c47fec80c00 100644
--- a/pkg/analyzer/lib/src/summary/index_unit.dart
+++ b/pkg/analyzer/lib/src/summary/index_unit.dart
@@ -446,7 +446,10 @@ class _IndexContributor extends GeneralizingAstVisitor {
element is PropertyAccessorElement ||
element is FunctionElement ||
element is VariableElement) {
- recordRelation(element, IndexRelationKind.IS_INVOKED_BY, name);
+ IndexRelationKind kind = node.realTarget != null
+ ? IndexRelationKind.IS_INVOKED_QUALIFIED_BY
+ : IndexRelationKind.IS_INVOKED_BY;
+ recordRelation(element, kind, name);
} else if (element is ClassElement) {
recordRelation(element, IndexRelationKind.IS_REFERENCED_BY, name);
}
@@ -511,19 +514,10 @@ class _IndexContributor extends GeneralizingAstVisitor {
return;
}
// record specific relations
- // TODO(scheglov) consider removing the conditions
- if (element is ClassElement ||
- element is FunctionElement ||
- element is FunctionTypeAliasElement ||
- element is LabelElement ||
- element is MethodElement ||
- element is ParameterElement ||
- element is PrefixElement ||
- element is PropertyAccessorElement ||
- element is PropertyInducingElement ||
- element is TypeParameterElement) {
- recordRelation(element, IndexRelationKind.IS_REFERENCED_BY, node);
- }
+ IndexRelationKind kind = node.isQualified
+ ? IndexRelationKind.IS_REFERENCED_QUALIFIED_BY
+ : IndexRelationKind.IS_REFERENCED_BY;
+ recordRelation(element, kind, node);
}
@override
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/test/src/summary/index_unit_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698