Skip to content

Commit 009a619

Browse files
kallentuCommit Queue
authored andcommitted
[analysis_server] Dot shorthands: Call hierarchy changes and tests.
Added work and tests needed for the call hierarchy to handle dot shorthands. The element locator needed to be updated for the call hierarchy to work, so I updated that too. Unit tests passing. Bug: #59836 Change-Id: Id61e6071c5ff008300f7bd25f762a14f22e47595 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431701 Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Kallen Tu <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent b980788 commit 009a619

File tree

5 files changed

+1070
-0
lines changed

5 files changed

+1070
-0
lines changed

pkg/analysis_server/lib/src/computer/computer_call_hierarchy.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,26 @@ class _OutboundCallVisitor extends RecursiveAstVisitor<void> {
468468
super.visitConstructorName(node);
469469
}
470470

471+
@override
472+
void visitDotShorthandConstructorInvocation(
473+
DotShorthandConstructorInvocation node,
474+
) {
475+
collect(node.constructorName);
476+
super.visitDotShorthandConstructorInvocation(node);
477+
}
478+
479+
@override
480+
void visitDotShorthandInvocation(DotShorthandInvocation node) {
481+
collect(node.memberName);
482+
super.visitDotShorthandInvocation(node);
483+
}
484+
485+
@override
486+
void visitDotShorthandPropertyAccess(DotShorthandPropertyAccess node) {
487+
collect(node.propertyName);
488+
super.visitDotShorthandPropertyAccess(node);
489+
}
490+
471491
@override
472492
void visitFunctionDeclaration(FunctionDeclaration node) {
473493
// Only descend into function declarations if they are the target/root

0 commit comments

Comments
 (0)