@@ -20,7 +20,6 @@ import fs from '../fs/fs'
2020import { ChildProcess } from './processUtils'
2121import { isWin } from '../vscode/env'
2222import { maxRepoSizeBytes } from '../../amazonqFeatureDev/constants'
23- import { FeatureUseCase } from '../../codewhisperer/models/constants'
2423
2524type GitIgnoreRelativeAcceptor = {
2625 folderPath : string
@@ -224,18 +223,12 @@ export function getWorkspaceRelativePath(
224223 workspaceFolders ?: readonly vscode . WorkspaceFolder [ ]
225224 } = {
226225 workspaceFolders : vscode . workspace . workspaceFolders ,
227- } ,
228- useCase ?: FeatureUseCase
226+ }
229227) : { relativePath : string ; workspaceFolder : vscode . WorkspaceFolder } | undefined {
230228 if ( ! override . workspaceFolders ) {
231229 return
232230 }
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
239232
240233 for ( const folder of folders ) {
241234 if ( isInDirectory ( folder . uri . fsPath , childPath ) ) {
@@ -361,8 +354,7 @@ export async function collectFiles(
361354 excludeByGitIgnore ?: boolean // default true
362355 excludePatterns ?: string [ ] // default defaultExcludePatterns
363356 filterFn ?: CollectFilesFilter
364- } ,
365- useCase ?: FeatureUseCase
357+ }
366358) : Promise < CollectFilesResultItem [ ] > {
367359 const storage : Awaited < CollectFilesResultItem [ ] > = [ ]
368360
@@ -408,7 +400,7 @@ export async function collectFiles(
408400 const files = excludeByGitIgnore ? await filterOutGitignoredFiles ( rootPath , allFiles , false ) : allFiles
409401
410402 for ( const file of files ) {
411- const relativePath = getWorkspaceRelativePath ( file . fsPath , { workspaceFolders } , useCase )
403+ const relativePath = getWorkspaceRelativePath ( file . fsPath , { workspaceFolders } )
412404 if ( ! relativePath ) {
413405 continue
414406 }
0 commit comments