File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
analyzer_plugin/lib/src/utilities/navigation Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1099,6 +1099,21 @@ class [!A!] {}
1099
1099
await testContents (contents);
1100
1100
}
1101
1101
1102
+ Future <void > test_unexisting_implicit_new_constructor () async {
1103
+ var contents = '''
1104
+ class [!A!] {
1105
+ A.constructor();
1106
+ }
1107
+
1108
+ void f() {
1109
+ // ignore: new_with_undefined_constructor_default
1110
+ A^();
1111
+ }
1112
+ ''' ;
1113
+
1114
+ await testContents (contents);
1115
+ }
1116
+
1102
1117
Future <void > test_unopenFile () async {
1103
1118
var contents = '''
1104
1119
[!foo!]() {
Original file line number Diff line number Diff line change @@ -454,6 +454,17 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor<void> {
454
454
computer._addRegionForElement (node.rightBracket, element);
455
455
}
456
456
457
+ @override
458
+ void visitInstanceCreationExpression (InstanceCreationExpression node) {
459
+ if (node.constructorName.element == null ) {
460
+ computer._addRegionForElement (
461
+ node.constructorName,
462
+ node.constructorName.type.element2,
463
+ );
464
+ }
465
+ super .visitInstanceCreationExpression (node);
466
+ }
467
+
457
468
@override
458
469
void visitLibraryDirective (LibraryDirective node) {
459
470
computer._addRegionForElement (node.name2, node.element2);
You can’t perform that action at this time.
0 commit comments