Skip to content

Commit 8aebb4a

Browse files
Merge master into feature/serverlessland
2 parents 3c29e0f + 4b20c5a commit 8aebb4a

File tree

9 files changed

+236
-208
lines changed

9 files changed

+236
-208
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ 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'
5354

5455
const localize = nls.loadMessageBundle()
5556
export const stopScanButton = localize('aws.codewhisperer.stopscan', 'Stop Scan')
@@ -156,7 +157,7 @@ export async function startSecurityScan(
156157
})
157158
}
158159
const zipMetadata = await zipUtil.generateZip(editor?.document.uri, scope)
159-
const projectPaths = zipUtil.getProjectPaths()
160+
const projectPaths = getWorkspacePaths()
160161

161162
const contextTruncationStartTime = performance.now()
162163
codeScanTelemetryEntry.contextTruncationDuration = performance.now() - contextTruncationStartTime

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ 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'
2425

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

4950
const zipUtil = new ZipUtil()
5051
if (initialExecution) {
51-
const projectPath = zipUtil.getProjectPath(filePath) ?? ''
52+
const projectPath = getWorkspaceForFile(filePath) ?? ''
5253
const relativeTargetPath = path.relative(projectPath, filePath)
5354
session.listOfTestGenerationJobId = []
5455
session.shortAnswer = undefined

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,3 +926,7 @@ 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)