@@ -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