@@ -79,7 +79,7 @@ void foo() {
79
79
}
80
80
81
81
Future <void > test_import_double () async {
82
- newFile ('/home/my_project/ lib/ other.dart' , '''
82
+ newFile (join (projectFolderPath, ' lib' , ' other.dart') , '''
83
83
export 'dart:math';
84
84
''' );
85
85
await _verifyGoToImports (
@@ -93,10 +93,10 @@ Rando^m? r;
93
93
}
94
94
95
95
Future <void > test_import_double_ambiguous () async {
96
- newFile ('/home/my_project/ lib/ a1.dart' , '''
96
+ newFile (join (projectFolderPath, ' lib' , ' a1.dart') , '''
97
97
class A {}
98
98
''' );
99
- newFile ('/home/my_project/ lib/ a2.dart' , '''
99
+ newFile (join (projectFolderPath, ' lib' , ' a2.dart') , '''
100
100
class A {}
101
101
''' );
102
102
await _verifyGoToImports (
@@ -111,10 +111,10 @@ class A {}
111
111
}
112
112
113
113
Future <void > test_import_double_hide () async {
114
- newFile ('/home/my_project/ lib/ a1.dart' , '''
114
+ newFile (join (projectFolderPath, ' lib' , ' a1.dart') , '''
115
115
class A {}
116
116
''' );
117
- newFile ('/home/my_project/ lib/ a2.dart' , '''
117
+ newFile (join (projectFolderPath, ' lib' , ' a2.dart') , '''
118
118
class A {}
119
119
''' );
120
120
await _verifyGoToImports (
@@ -128,7 +128,7 @@ import 'a1.dart' hide A;
128
128
}
129
129
130
130
Future <void > test_import_double_same_different_alias () async {
131
- newFile ('/home/my_project/ lib/ other.dart' , '''
131
+ newFile (join (projectFolderPath, ' lib' , ' other.dart') , '''
132
132
export 'dart:math';
133
133
''' );
134
134
await _verifyGoToImports (
@@ -142,7 +142,7 @@ other.Rando^m? r;
142
142
}
143
143
144
144
Future <void > test_import_double_same_different_alias_prefix () async {
145
- newFile ('/home/my_project/ lib/ other.dart' , '''
145
+ newFile (join (projectFolderPath, ' lib' , ' other.dart') , '''
146
146
export 'dart:math';
147
147
''' );
148
148
await _verifyGoToImports (
@@ -156,12 +156,12 @@ other.Ran^dom? r;
156
156
}
157
157
158
158
Future <void > test_import_double_show () async {
159
- newFile ('/home/my_project/ lib/ a1.dart' , '''
159
+ newFile (join (projectFolderPath, ' lib' , ' a1.dart') , '''
160
160
class A {}
161
161
162
162
class B {}
163
163
''' );
164
- newFile ('/home/my_project/ lib/ a2.dart' , '''
164
+ newFile (join (projectFolderPath, ' lib' , ' a2.dart') , '''
165
165
class A {}
166
166
''' );
167
167
await _verifyGoToImports (
@@ -175,10 +175,10 @@ import 'a1.dart' show B;
175
175
}
176
176
177
177
Future <void > test_import_double_unambiguous_aliased () async {
178
- newFile ('/home/my_project/ lib/ a1.dart' , '''
178
+ newFile (join (projectFolderPath, ' lib' , ' a1.dart') , '''
179
179
class A {}
180
180
''' );
181
- newFile ('/home/my_project/ lib/ a2.dart' , '''
181
+ newFile (join (projectFolderPath, ' lib' , ' a2.dart') , '''
182
182
class A {}
183
183
''' );
184
184
await _verifyGoToImports (
@@ -371,7 +371,7 @@ math.Rando^m? r;
371
371
}
372
372
373
373
Future <void > test_import_single_exported () async {
374
- newFile ('/home/my_project/ lib/ other.dart' , '''
374
+ newFile (join (projectFolderPath, ' lib' , ' other.dart') , '''
375
375
export 'dart:math';
376
376
''' );
377
377
await _verifyGoToImports (
@@ -397,7 +397,7 @@ class LocalClass {}
397
397
}
398
398
399
399
Future <void > test_nestedInvocations () async {
400
- newFile ('/home/my_project/ lib/ other.dart' , '''
400
+ newFile (join (projectFolderPath, ' lib' , ' other.dart') , '''
401
401
class A {
402
402
const A();
403
403
A foo() => A();
@@ -414,7 +414,7 @@ var a = A().foo().ba^r();
414
414
}
415
415
416
416
Future <void > test_nestedInvocations_extension () async {
417
- newFile ('/home/my_project/ lib/ other.dart' , '''
417
+ newFile (join (projectFolderPath, ' lib' , ' other.dart') , '''
418
418
extension E on int {
419
419
void bar() {}
420
420
}
@@ -428,6 +428,36 @@ var a = 1.abs().ba^r();
428
428
);
429
429
}
430
430
431
+ Future <void > test_staticDeclarations () async {
432
+ newFile (join (projectFolderPath, 'lib' , 'other.dart' ), '''
433
+ class A {
434
+ static const a = 1;
435
+ }
436
+ ''' );
437
+ await _verifyGoToImports (
438
+ TestCode .parse ('''
439
+ [!import 'other.dart';!]
440
+
441
+ var a = A^.a;
442
+ ''' ),
443
+ );
444
+ }
445
+
446
+ Future <void > test_staticDeclarations_prefixed () async {
447
+ newFile (join (projectFolderPath, 'lib' , 'other.dart' ), '''
448
+ class A {
449
+ static const a = 1;
450
+ }
451
+ ''' );
452
+ await _verifyGoToImports (
453
+ TestCode .parse ('''
454
+ [!import 'other.dart' as o;!]
455
+
456
+ var a = o.A^.a;
457
+ ''' ),
458
+ );
459
+ }
460
+
431
461
Future <void > _verifyGoToImports (
432
462
TestCode code, {
433
463
Uri ? fileUri,
0 commit comments