@@ -372,6 +372,7 @@ export const openSecurityIssuePanel = Commands.declare(
372372 undefined ,
373373 ! ! targetIssue . suggestedFixes . length
374374 )
375+ await generateFix . execute ( targetIssue , targetFilePath , 'webview' , true , false )
375376 }
376377)
377378
@@ -665,7 +666,8 @@ export const generateFix = Commands.declare(
665666 issue : CodeScanIssue | IssueItem | undefined ,
666667 filePath : string ,
667668 source : Component ,
668- refresh : boolean = false
669+ refresh : boolean = false ,
670+ shouldOpenSecurityIssuePanel : boolean = true
669671 ) => {
670672 const targetIssue : CodeScanIssue | undefined = issue instanceof IssueItem ? issue . issue : issue
671673 const targetFilePath : string = issue instanceof IssueItem ? issue . filePath : filePath
@@ -679,11 +681,13 @@ export const generateFix = Commands.declare(
679681 }
680682 await telemetry . codewhisperer_codeScanIssueGenerateFix . run ( async ( ) => {
681683 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- } )
684+ if ( shouldOpenSecurityIssuePanel ) {
685+ await vscode . commands
686+ . executeCommand ( 'aws.amazonq.openSecurityIssuePanel' , targetIssue , targetFilePath )
687+ . then ( undefined , ( e ) => {
688+ getLogger ( ) . error ( 'Failed to open security issue panel: %s' , e . message )
689+ } )
690+ }
687691 await updateSecurityIssueWebview ( {
688692 isGenerateFixLoading : true ,
689693 // eslint-disable-next-line unicorn/no-null
@@ -739,7 +743,7 @@ export const generateFix = Commands.declare(
739743 isGenerateFixLoading : false ,
740744 filePath : targetFilePath ,
741745 context : context . extensionContext ,
742- shouldRefreshView : true ,
746+ shouldRefreshView : false ,
743747 } )
744748
745749 SecurityIssueProvider . instance . updateIssue ( updatedIssue , targetFilePath )
0 commit comments