@@ -134,6 +134,22 @@ final b = new Foo.named(); // 0
134
134
expect (target.length, 5 );
135
135
}
136
136
137
+ Future <void > test_field_underscore () async {
138
+ addTestFile ('''
139
+ class C {
140
+ int _ = 0;
141
+ }
142
+
143
+ f() {
144
+ C()._;
145
+ }
146
+ ''' );
147
+ await waitForTasksFinished ();
148
+ await _getNavigation (search: '_;' );
149
+ assertHasRegion ('_;' );
150
+ assertHasTarget ('_ = 0' );
151
+ }
152
+
137
153
Future <void > test_fieldType () async {
138
154
// This test mirrors test_navigation() from
139
155
// test/integration/analysis/get_navigation_test.dart
@@ -336,6 +352,17 @@ void f(A a) {
336
352
}
337
353
}
338
354
355
+ Future <void > test_parameter_wildcard () async {
356
+ addTestFile ('''
357
+ var _ = 0;
358
+ f(int _) { }
359
+ ''' );
360
+ await waitForTasksFinished ();
361
+ await _getNavigation (search: '_)' );
362
+ assertHasRegion ('_)' );
363
+ assertHasTarget ('_)' );
364
+ }
365
+
339
366
Future <void > test_partDirective () async {
340
367
var partFile = newFile (
341
368
'$testPackageLibPath /a.dart' ,
@@ -394,6 +421,40 @@ part of 'a.dart';
394
421
assertHasFileTarget (partOfFile.path, 0 , 0 );
395
422
}
396
423
424
+ Future <void > test_prefix_wildcard () async {
425
+ addTestFile ('''
426
+ import 'dart:io' as _;
427
+ ''' );
428
+ await waitForTasksFinished ();
429
+ await _getNavigation (search: '_' );
430
+ assertHasRegion ('_' );
431
+ assertHasTarget ('_' );
432
+ }
433
+
434
+ Future <void > test_topLevelVariable_underscore () async {
435
+ addTestFile ('''
436
+ var _ = 0;
437
+
438
+ f(int _) {
439
+ _;
440
+ }
441
+ ''' );
442
+ await waitForTasksFinished ();
443
+ await _getNavigation (search: '_;' );
444
+ assertHasRegion ('_;' );
445
+ assertHasTarget ('_ = 0' );
446
+ }
447
+
448
+ Future <void > test_typeParameter_wildcard () async {
449
+ addTestFile ('''
450
+ class C<_> {}
451
+ ''' );
452
+ await waitForTasksFinished ();
453
+ await _getNavigation (search: '_' );
454
+ assertHasRegion ('_' );
455
+ assertHasTarget ('_' );
456
+ }
457
+
397
458
Future <void > test_zeroLength_end () async {
398
459
addTestFile ('''
399
460
void f() {
0 commit comments