@@ -372,6 +372,9 @@ export const openSecurityIssuePanel = Commands.declare(
372
372
undefined ,
373
373
! ! targetIssue . suggestedFixes . length
374
374
)
375
+ if ( targetIssue . suggestedFixes . length === 0 ) {
376
+ await generateFix . execute ( targetIssue , targetFilePath , 'webview' , true , false )
377
+ }
375
378
}
376
379
)
377
380
@@ -665,7 +668,8 @@ export const generateFix = Commands.declare(
665
668
issue : CodeScanIssue | IssueItem | undefined ,
666
669
filePath : string ,
667
670
source : Component ,
668
- refresh : boolean = false
671
+ refresh : boolean = false ,
672
+ shouldOpenSecurityIssuePanel : boolean = true
669
673
) => {
670
674
const targetIssue : CodeScanIssue | undefined = issue instanceof IssueItem ? issue . issue : issue
671
675
const targetFilePath : string = issue instanceof IssueItem ? issue . filePath : filePath
@@ -679,11 +683,13 @@ export const generateFix = Commands.declare(
679
683
}
680
684
await telemetry . codewhisperer_codeScanIssueGenerateFix . run ( async ( ) => {
681
685
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
+ }
687
693
await updateSecurityIssueWebview ( {
688
694
isGenerateFixLoading : true ,
689
695
// eslint-disable-next-line unicorn/no-null
0 commit comments