@@ -20,7 +20,6 @@ import fs from '../fs/fs'
20
20
import { ChildProcess } from './processUtils'
21
21
import { isWin } from '../vscode/env'
22
22
import { maxRepoSizeBytes } from '../../amazonqFeatureDev/constants'
23
- import { FeatureUseCase } from '../../codewhisperer/models/constants'
24
23
25
24
type GitIgnoreRelativeAcceptor = {
26
25
folderPath : string
@@ -224,18 +223,12 @@ export function getWorkspaceRelativePath(
224
223
workspaceFolders ?: readonly vscode . WorkspaceFolder [ ]
225
224
} = {
226
225
workspaceFolders : vscode . workspace . workspaceFolders ,
227
- } ,
228
- useCase ?: FeatureUseCase
226
+ }
229
227
) : { relativePath : string ; workspaceFolder : vscode . WorkspaceFolder } | undefined {
230
228
if ( ! override . workspaceFolders ) {
231
229
return
232
230
}
233
- 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
- }
231
+ const folders = override . workspaceFolders
239
232
240
233
for ( const folder of folders ) {
241
234
if ( isInDirectory ( folder . uri . fsPath , childPath ) ) {
@@ -361,8 +354,7 @@ export async function collectFiles(
361
354
excludeByGitIgnore ?: boolean // default true
362
355
excludePatterns ?: string [ ] // default defaultExcludePatterns
363
356
filterFn ?: CollectFilesFilter
364
- } ,
365
- useCase ?: FeatureUseCase
357
+ }
366
358
) : Promise < CollectFilesResultItem [ ] > {
367
359
const storage : Awaited < CollectFilesResultItem [ ] > = [ ]
368
360
@@ -408,7 +400,7 @@ export async function collectFiles(
408
400
const files = excludeByGitIgnore ? await filterOutGitignoredFiles ( rootPath , allFiles , false ) : allFiles
409
401
410
402
for ( const file of files ) {
411
- const relativePath = getWorkspaceRelativePath ( file . fsPath , { workspaceFolders } , useCase )
403
+ const relativePath = getWorkspaceRelativePath ( file . fsPath , { workspaceFolders } )
412
404
if ( ! relativePath ) {
413
405
continue
414
406
}
0 commit comments