Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
import { SecurityIssueTreeViewProvider } from '../service/securityIssueTreeViewProvider'
import { ChatSessionManager } from '../../amazonqScan/chat/storages/chatSession'
import { TelemetryHelper } from '../util/telemetryHelper'
import { getWorkspacePaths } from '../../shared/utilities/workspaceUtils'

const localize = nls.loadMessageBundle()
export const stopScanButton = localize('aws.codewhisperer.stopscan', 'Stop Scan')
Expand Down Expand Up @@ -156,7 +157,7 @@ export async function startSecurityScan(
})
}
const zipMetadata = await zipUtil.generateZip(editor?.document.uri, scope)
const projectPaths = zipUtil.getProjectPaths()
const projectPaths = getWorkspacePaths()

const contextTruncationStartTime = performance.now()
codeScanTelemetryEntry.contextTruncationDuration = performance.now() - contextTruncationStartTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ChildProcess, spawn } from 'child_process' // eslint-disable-line no-re
import { BuildStatus } from '../../amazonqTest/chat/session/session'
import { fs } from '../../shared/fs/fs'
import { Range } from '../client/codewhispereruserclient'
import { getWorkspaceForFile } from '../../shared/utilities/workspaceUtils'

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

const zipUtil = new ZipUtil()
if (initialExecution) {
const projectPath = zipUtil.getProjectPath(filePath) ?? ''
const projectPath = getWorkspaceForFile(filePath) ?? ''
const relativeTargetPath = path.relative(projectPath, filePath)
session.listOfTestGenerationJobId = []
session.shortAnswer = undefined
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/codewhisperer/models/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,3 +926,7 @@ export const testGenExcludePatterns = [
'**/*.deb',
'**/*.model',
]

export const isFileAnalysisScope = (scope: CodeAnalysisScope) => {
return scope === CodeAnalysisScope.FILE_AUTO || scope === CodeAnalysisScope.FILE_ON_DEMAND
}
Loading
Loading