@@ -293,18 +293,14 @@ export const defaultExcludePatterns = [
293
293
'**/LICENSE.md' ,
294
294
]
295
295
296
- export function getExcludePattern ( useDefaults : boolean = true , useCase ?: FeatureUseCase ) {
296
+ export function getExcludePattern ( useDefaults : boolean = true ) {
297
297
const globAlwaysExcludedDirs = getGlobalExcludePatterns ( )
298
298
const allPatterns = [ ...globAlwaysExcludedDirs ]
299
299
300
300
if ( useDefaults ) {
301
301
allPatterns . push ( ...defaultExcludePatterns )
302
302
}
303
303
304
- if ( useCase === FeatureUseCase . TEST_GENERATION ) {
305
- allPatterns . push ( ...testGenExcludePatterns )
306
- }
307
-
308
304
return excludePatternsAsString ( allPatterns )
309
305
}
310
306
@@ -325,12 +321,11 @@ function excludePatternsAsString(patterns: string[]): string {
325
321
async function filterOutGitignoredFiles (
326
322
rootPath : string ,
327
323
files : vscode . Uri [ ] ,
328
- useDefaultExcludePatterns : boolean = true ,
329
- useCase ?: FeatureUseCase
324
+ useDefaultExcludePatterns : boolean = true
330
325
) : Promise < vscode . Uri [ ] > {
331
326
const gitIgnoreFiles = await vscode . workspace . findFiles (
332
327
new vscode . RelativePattern ( rootPath , '**/.gitignore' ) ,
333
- getExcludePattern ( useCase === FeatureUseCase . TEST_GENERATION ? true : useDefaultExcludePatterns , useCase )
328
+ getExcludePattern ( useDefaultExcludePatterns )
334
329
)
335
330
const gitIgnoreFilter = await GitIgnoreFilter . build ( gitIgnoreFiles )
336
331
return gitIgnoreFilter . filterFiles ( files )
@@ -392,7 +387,10 @@ export async function collectFiles(
392
387
const inputExcludePatterns = options ?. excludePatterns ?? defaultExcludePatterns
393
388
const maxSizeBytes = options ?. maxSizeBytes ?? maxRepoSizeBytes
394
389
395
- const excludePatterns = [ ...getGlobalExcludePatterns ( ) ]
390
+ const excludePatterns = [
391
+ ...getGlobalExcludePatterns ( ) ,
392
+ ...( useCase === FeatureUseCase . TEST_GENERATION ? [ ...testGenExcludePatterns , ...defaultExcludePatterns ] : [ ] ) ,
393
+ ]
396
394
if ( inputExcludePatterns . length ) {
397
395
excludePatterns . push ( ...inputExcludePatterns )
398
396
}
@@ -404,7 +402,7 @@ export async function collectFiles(
404
402
excludePatternFilter
405
403
)
406
404
407
- const files = excludeByGitIgnore ? await filterOutGitignoredFiles ( rootPath , allFiles , false , useCase ) : allFiles
405
+ const files = excludeByGitIgnore ? await filterOutGitignoredFiles ( rootPath , allFiles , false ) : allFiles
408
406
409
407
for ( const file of files ) {
410
408
const relativePath = getWorkspaceRelativePath ( file . fsPath , { workspaceFolders } )
0 commit comments