@@ -1487,6 +1487,7 @@ main() {
14871487 }
14881488
14891489 test_searchReferences_FunctionElement_local () async {
1490+ makeFilePriority (testFile);
14901491 await resolveTestCode ('''
14911492main() {
14921493 test() {}
@@ -1602,6 +1603,7 @@ main() {
16021603 }
16031604
16041605 test_searchReferences_LabelElement () async {
1606+ makeFilePriority (testFile);
16051607 await resolveTestCode ('''
16061608main() {
16071609label:
@@ -1693,6 +1695,7 @@ part 'unitB.dart';
16931695 }
16941696
16951697 test_searchReferences_LocalVariableElement () async {
1698+ makeFilePriority (testFile);
16961699 await resolveTestCode (r'''
16971700main() {
16981701 var v;
@@ -1713,6 +1716,7 @@ main() {
17131716 }
17141717
17151718 test_searchReferences_LocalVariableElement_inForEachElement_expressionBody () async {
1719+ makeFilePriority (testFile);
17161720 await resolveTestCode ('''
17171721Object f() => [
17181722 for (var v in []) v,
@@ -1726,6 +1730,7 @@ Object f() => [
17261730 }
17271731
17281732 test_searchReferences_LocalVariableElement_inForEachElement_inBlock () async {
1733+ makeFilePriority (testFile);
17291734 await resolveTestCode ('''
17301735Object f() {
17311736 {
@@ -1743,6 +1748,7 @@ Object f() {
17431748 }
17441749
17451750 test_searchReferences_LocalVariableElement_inForEachElement_inFunctionBody () async {
1751+ makeFilePriority (testFile);
17461752 await resolveTestCode ('''
17471753Object f() {
17481754 return [
@@ -1758,6 +1764,7 @@ Object f() {
17581764 }
17591765
17601766 test_searchReferences_LocalVariableElement_inForEachElement_topLevel () async {
1767+ makeFilePriority (testFile);
17611768 await resolveTestCode ('''
17621769var x = [
17631770 for (var v in []) v,
@@ -1771,6 +1778,7 @@ var x = [
17711778 }
17721779
17731780 test_searchReferences_LocalVariableElement_inForEachLoop () async {
1781+ makeFilePriority (testFile);
17741782 await resolveTestCode ('''
17751783main() {
17761784 for (var v in []) {
@@ -1793,16 +1801,7 @@ main() {
17931801
17941802 test_searchReferences_LocalVariableElement_inPackage () async {
17951803 var aaaPackageRootPath = '$packagesRootPath /aaa' ;
1796- var testPath = convertPath ('$aaaPackageRootPath /lib/a.dart' );
1797-
1798- writeTestPackageConfig (
1799- PackageConfigFileBuilder ()
1800- ..add (name: 'aaa' , rootPath: aaaPackageRootPath),
1801- );
1802-
1803- fileForContextSelection = testFile;
1804-
1805- await resolveFileCode (testPath, '''
1804+ var a_file = newFile ('$aaaPackageRootPath /lib/a.dart' , '''
18061805main() {
18071806 var v;
18081807 v = 1;
@@ -1811,6 +1810,17 @@ main() {
18111810 v();
18121811}
18131812''' );
1813+
1814+ writeTestPackageConfig (
1815+ PackageConfigFileBuilder ()
1816+ ..add (name: 'aaa' , rootPath: aaaPackageRootPath),
1817+ );
1818+
1819+ fileForContextSelection = testFile;
1820+
1821+ driverFor (testFile).priorityFiles2 = [a_file];
1822+ await resolveFile2 (a_file);
1823+
18141824 var element = findElement2.localVar ('v' );
18151825 await assertElementReferencesText (element, r'''
18161826package:aaa/a.dart::<fragment>::@function::main
@@ -2191,6 +2201,7 @@ main() {
21912201 }
21922202
21932203 test_searchReferences_ParameterElement_requiredPositional_ofLocalFunction () async {
2204+ makeFilePriority (testFile);
21942205 await resolveTestCode ('''
21952206main() {
21962207 foo(p) {
@@ -2753,6 +2764,7 @@ void f(Object? x) {
27532764 }
27542765
27552766 test_searchReferences_VariablePatternElement_patternAssignment () async {
2767+ makeFilePriority (testFile);
27562768 await resolveTestCode ('''
27572769void f() {
27582770 int v;
0 commit comments