Skip to content

Commit ba9fe3e

Browse files
Merge master into feature/falcon
2 parents b69cbf6 + 65a1fc5 commit ba9fe3e

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "/review: automatically generate fix without clicking Generate Fix button"
4+
}

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ export const openSecurityIssuePanel = Commands.declare(
372372
undefined,
373373
!!targetIssue.suggestedFixes.length
374374
)
375+
if (targetIssue.suggestedFixes.length === 0) {
376+
await generateFix.execute(targetIssue, targetFilePath, 'webview', true, false)
377+
}
375378
}
376379
)
377380

@@ -665,7 +668,8 @@ export const generateFix = Commands.declare(
665668
issue: CodeScanIssue | IssueItem | undefined,
666669
filePath: string,
667670
source: Component,
668-
refresh: boolean = false
671+
refresh: boolean = false,
672+
shouldOpenSecurityIssuePanel: boolean = true
669673
) => {
670674
const targetIssue: CodeScanIssue | undefined = issue instanceof IssueItem ? issue.issue : issue
671675
const targetFilePath: string = issue instanceof IssueItem ? issue.filePath : filePath
@@ -679,11 +683,13 @@ export const generateFix = Commands.declare(
679683
}
680684
await telemetry.codewhisperer_codeScanIssueGenerateFix.run(async () => {
681685
try {
682-
await vscode.commands
683-
.executeCommand('aws.amazonq.openSecurityIssuePanel', targetIssue, targetFilePath)
684-
.then(undefined, (e) => {
685-
getLogger().error('Failed to open security issue panel: %s', e.message)
686-
})
686+
if (shouldOpenSecurityIssuePanel) {
687+
await vscode.commands
688+
.executeCommand('aws.amazonq.openSecurityIssuePanel', targetIssue, targetFilePath)
689+
.then(undefined, (e) => {
690+
getLogger().error('Failed to open security issue panel: %s', e.message)
691+
})
692+
}
687693
await updateSecurityIssueWebview({
688694
isGenerateFixLoading: true,
689695
// eslint-disable-next-line unicorn/no-null

0 commit comments

Comments
 (0)