@@ -91,7 +91,7 @@ private async IAsyncEnumerable<DiscoveryResult> FindAllSolutionsAndProjects(stri
91
91
return null ;
92
92
93
93
// Check for the project/solution to test with was found
94
- FindProjectOrSolution ( rootDir , itemPath , out string ? project , out int countOfSln , out int countOfProjs , out int countOfCode , out int countOfSpecial , ref projectsFound ) ;
94
+ FindProjectOrSolution ( rootDir , itemPath , itemWasDeleted , out string ? project , out int countOfSln , out int countOfProjs , out int countOfCode , out int countOfSpecial , ref projectsFound ) ;
95
95
96
96
// If it's a solution file, check that all the projects are referenced in it:
97
97
if ( countOfSln == 1 )
@@ -134,7 +134,7 @@ private async IAsyncEnumerable<DiscoveryResult> FindAllSolutionsAndProjects(stri
134
134
} ;
135
135
}
136
136
137
- static void FindProjectOrSolution ( string rootDir , string itemDirectory , out string ? project , out int countOfSln , out int countOfProjs , out int countOfCode , out int countOfSpecial , ref List < string > projectsFound )
137
+ static void FindProjectOrSolution ( string rootDir , string itemDirectory , bool isDeleted , out string ? project , out int countOfSln , out int countOfProjs , out int countOfCode , out int countOfSpecial , ref List < string > projectsFound )
138
138
{
139
139
project = null ;
140
140
countOfSln = 0 ;
@@ -146,7 +146,8 @@ static void FindProjectOrSolution(string rootDir, string itemDirectory, out stri
146
146
// If a file is deleted, and no other content is there, the directory won't exist
147
147
if ( Directory . Exists ( itemDirectory ) )
148
148
{
149
- foreach ( var file in Directory . EnumerateFiles ( itemDirectory , $ "*.*", SearchOption . AllDirectories ) )
149
+ // If the item is deleted, we don't need to scan it, but we do need to scan the parents
150
+ foreach ( var file in Directory . EnumerateFiles ( itemDirectory , $ "*.*", isDeleted ? SearchOption . TopDirectoryOnly : SearchOption . AllDirectories ) )
150
151
ScanFile ( file , ref project , ref countOfSln , ref countOfProjs , ref countOfCode , ref countOfSpecial , ref projectsFound ) ;
151
152
}
152
153
0 commit comments