@@ -224,18 +224,12 @@ export function getWorkspaceRelativePath(
224
224
workspaceFolders ?: readonly vscode . WorkspaceFolder [ ]
225
225
} = {
226
226
workspaceFolders : vscode . workspace . workspaceFolders ,
227
- } ,
228
- useCase ?: FeatureUseCase
227
+ }
229
228
) : { relativePath : string ; workspaceFolder : vscode . WorkspaceFolder } | undefined {
230
229
if ( ! override . workspaceFolders ) {
231
230
return
232
231
}
233
232
let folders = override . workspaceFolders
234
- if ( useCase && useCase === FeatureUseCase . TEST_GENERATION ) {
235
- // Sort workspace folders by path length (descending) to prioritize deeper paths
236
- // TODO: Need to enable this for entire Q
237
- folders = [ ...override . workspaceFolders ] . sort ( ( a , b ) => b . uri . fsPath . length - a . uri . fsPath . length )
238
- }
239
233
240
234
for ( const folder of folders ) {
241
235
if ( isInDirectory ( folder . uri . fsPath , childPath ) ) {
@@ -410,10 +404,10 @@ export async function collectFiles(
410
404
excludePatternFilter
411
405
)
412
406
413
- const files = excludeByGitIgnore ? await filterOutGitignoredFiles ( rootPath , allFiles , false ) : allFiles
407
+ const files = excludeByGitIgnore ? await filterOutGitignoredFiles ( rootPath , allFiles , false , useCase ) : allFiles
414
408
415
409
for ( const file of files ) {
416
- const relativePath = getWorkspaceRelativePath ( file . fsPath , { workspaceFolders } , useCase )
410
+ const relativePath = getWorkspaceRelativePath ( file . fsPath , { workspaceFolders } )
417
411
if ( ! relativePath ) {
418
412
continue
419
413
}
0 commit comments