File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { fs } from '../../shared/fs/fs'
1313import { getLoggerForScope } from '../service/securityScanHandler'
1414import { runtimeLanguageContext } from './runtimeLanguageContext'
1515import { CodewhispererLanguage } from '../../shared/telemetry/telemetry.gen'
16- import { CurrentWsFolders , collectFiles } from '../../shared/utilities/workspaceUtils'
16+ import { CurrentWsFolders , collectFiles , defaultExcludePatterns } from '../../shared/utilities/workspaceUtils'
1717import {
1818 FileSizeExceededError ,
1919 NoActiveFileError ,
@@ -419,8 +419,11 @@ export class ZipUtil {
419419 : vscode . workspace . workspaceFolders ) as CurrentWsFolders ,
420420 {
421421 maxSizeBytes : this . getProjectScanPayloadSizeLimitInBytes ( ) ,
422- } ,
423- useCase
422+ excludePatterns :
423+ useCase === 'TEST_GENERATION'
424+ ? [ ...CodeWhispererConstants . testGenExcludePatterns , ...defaultExcludePatterns ]
425+ : defaultExcludePatterns ,
426+ }
424427 )
425428 for ( const file of sourceFiles ) {
426429 const projectName = path . basename ( file . workspaceFolder . uri . fsPath )
Original file line number Diff line number Diff line change @@ -355,8 +355,7 @@ export async function collectFiles(
355355 excludeByGitIgnore ?: boolean // default true
356356 excludePatterns ?: string [ ] // default defaultExcludePatterns
357357 filterFn ?: CollectFilesFilter
358- } ,
359- useCase ?: FeatureUseCase
358+ }
360359) : Promise < CollectFilesResultItem [ ] > {
361360 const storage : Awaited < CollectFilesResultItem [ ] > = [ ]
362361
@@ -387,10 +386,7 @@ export async function collectFiles(
387386 const inputExcludePatterns = options ?. excludePatterns ?? defaultExcludePatterns
388387 const maxSizeBytes = options ?. maxSizeBytes ?? maxRepoSizeBytes
389388
390- const excludePatterns = [
391- ...getGlobalExcludePatterns ( ) ,
392- ...( useCase === FeatureUseCase . TEST_GENERATION ? [ ...testGenExcludePatterns , ...defaultExcludePatterns ] : [ ] ) ,
393- ]
389+ const excludePatterns = [ ...getGlobalExcludePatterns ( ) ]
394390 if ( inputExcludePatterns . length ) {
395391 excludePatterns . push ( ...inputExcludePatterns )
396392 }
You can’t perform that action at this time.
0 commit comments