Skip to content

Commit a527970

Browse files
authored
Merge pull request #6861 from Hweinstock/revert/zipUtilChanges
revert: zipUtil Changes
2 parents ddc9874 + d11e65d commit a527970

File tree

9 files changed

+208
-236
lines changed

9 files changed

+208
-236
lines changed

packages/core/src/codewhisperer/commands/startSecurityScan.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ import {
5050
import { SecurityIssueTreeViewProvider } from '../service/securityIssueTreeViewProvider'
5151
import { ChatSessionManager } from '../../amazonqScan/chat/storages/chatSession'
5252
import { TelemetryHelper } from '../util/telemetryHelper'
53-
import { getWorkspacePaths } from '../../shared/utilities/workspaceUtils'
5453

5554
const localize = nls.loadMessageBundle()
5655
export const stopScanButton = localize('aws.codewhisperer.stopscan', 'Stop Scan')
@@ -157,7 +156,7 @@ export async function startSecurityScan(
157156
})
158157
}
159158
const zipMetadata = await zipUtil.generateZip(editor?.document.uri, scope)
160-
const projectPaths = getWorkspacePaths()
159+
const projectPaths = zipUtil.getProjectPaths()
161160

162161
const contextTruncationStartTime = performance.now()
163162
codeScanTelemetryEntry.contextTruncationDuration = performance.now() - contextTruncationStartTime

packages/core/src/codewhisperer/commands/startTestGeneration.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { ChildProcess, spawn } from 'child_process' // eslint-disable-line no-re
2121
import { BuildStatus } from '../../amazonqTest/chat/session/session'
2222
import { fs } from '../../shared/fs/fs'
2323
import { Range } from '../client/codewhispereruserclient'
24-
import { getWorkspaceForFile } from '../../shared/utilities/workspaceUtils'
2524

2625
// eslint-disable-next-line unicorn/no-null
2726
let spawnResult: ChildProcess | null = null
@@ -49,7 +48,7 @@ export async function startTestGenerationProcess(
4948

5049
const zipUtil = new ZipUtil()
5150
if (initialExecution) {
52-
const projectPath = getWorkspaceForFile(filePath) ?? ''
51+
const projectPath = zipUtil.getProjectPath(filePath) ?? ''
5352
const relativeTargetPath = path.relative(projectPath, filePath)
5453
session.listOfTestGenerationJobId = []
5554
session.shortAnswer = undefined

packages/core/src/codewhisperer/models/constants.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,3 @@ export const testGenExcludePatterns = [
926926
'**/*.deb',
927927
'**/*.model',
928928
]
929-
930-
export const isFileAnalysisScope = (scope: CodeAnalysisScope) => {
931-
return scope === CodeAnalysisScope.FILE_AUTO || scope === CodeAnalysisScope.FILE_ON_DEMAND
932-
}

0 commit comments

Comments
 (0)