[DAS] Fixes import prefix occurrences on constructor invocation
Fixes: https://github.com/dart-lang/sdk/issues/61803 Change-Id: I313064a26e48f05c6c1408c24911dc77f8b9fad8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457220 Auto-Submit: Felipe Morschel <git@fmorschel.dev> Reviewed-by: Samuel Rawlins <srawlins@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
@@ -132,6 +132,8 @@ class DartUnitOccurrencesComputerVisitor extends GeneralizingAstVisitor<void> {
|
||||
if (element != null) {
|
||||
_addOccurrence(element, node.type.name);
|
||||
}
|
||||
// Still visit the import prefix if there is one.
|
||||
node.type.importPrefix?.accept(this);
|
||||
return; // skip visitNamedType.
|
||||
}
|
||||
|
||||
|
||||
@@ -637,12 +637,13 @@ class A {
|
||||
void m() {
|
||||
/*[1*/p/*1]*/.foo();
|
||||
print(/*[2*/p/*2]*/.a);
|
||||
/*[3*/p/*3]*/.A();
|
||||
}
|
||||
}
|
||||
|
||||
void foo() {}
|
||||
|
||||
/*[3*/p/*3]*/.A? a;
|
||||
/*[4*/p/*4]*/.A? a;
|
||||
''');
|
||||
}
|
||||
|
||||
|
||||
@@ -370,12 +370,13 @@ class A {
|
||||
void m() {
|
||||
/*[1*/p/*1]*/.foo();
|
||||
print(/*[2*/p/*2]*/.a);
|
||||
/*[3*/p/*3]*/.A();
|
||||
}
|
||||
}
|
||||
|
||||
void foo() {}
|
||||
|
||||
/*[3*/p/*3]*/.A? a;
|
||||
/*[4*/p/*4]*/.A? a;
|
||||
''');
|
||||
|
||||
Future<void> test_prefixed() => _testMarkedContent('''
|
||||
|
||||
Reference in New Issue
Block a user