Skip to content

Commit bb72ead

Browse files
committed
more logs
1 parent 2e090e7 commit bb72ead

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6+
/* eslint-disable aws-toolkits/no-console-log */
7+
68
import * as vscode from 'vscode'
79
import { CodewhispererCodeScanIssueApplyFix, Component, telemetry } from '../../shared/telemetry/telemetry'
810
import { ExtContext, VSCODE_EXTENSION_ID } from '../../shared/extensions'
@@ -365,9 +367,11 @@ export const updateReferenceLog = Commands.declare(
365367
export const openSecurityIssuePanel = Commands.declare(
366368
'aws.amazonq.openSecurityIssuePanel',
367369
(context: ExtContext) => async (issue: CodeScanIssue | IssueItem, filePath: string) => {
370+
console.log('in open security')
368371
const targetIssue: CodeScanIssue = issue instanceof IssueItem ? issue.issue : issue
369372
const targetFilePath: string = issue instanceof IssueItem ? issue.filePath : filePath
370373
await showSecurityIssueWebview(context.extensionContext, targetIssue, targetFilePath)
374+
console.log('in show securityIssueWebview')
371375

372376
telemetry.codewhisperer_codeScanIssueViewDetails.emit({
373377
findingId: targetIssue.findingId,
@@ -388,6 +392,7 @@ export const openSecurityIssuePanel = Commands.declare(
388392
!!targetIssue.suggestedFixes.length
389393
)
390394
if (targetIssue.suggestedFixes.length === 0) {
395+
console.log('going to generate fix as suggested fix length is 0')
391396
await generateFix.execute(targetIssue, targetFilePath, 'webview', true, false)
392397
}
393398
}
@@ -686,13 +691,18 @@ export const generateFix = Commands.declare(
686691
refresh: boolean = false,
687692
shouldOpenSecurityIssuePanel: boolean = true
688693
) => {
694+
console.log('in generate fix')
689695
const targetIssue: CodeScanIssue | undefined = issue instanceof IssueItem ? issue.issue : issue
690696
const targetFilePath: string = issue instanceof IssueItem ? issue.filePath : filePath
691697
const targetSource: Component = issue instanceof IssueItem ? 'tree' : source
698+
console.log('target issue', targetIssue)
699+
console.log('target file path', targetFilePath)
700+
console.log('target source', targetSource)
692701
if (!targetIssue) {
693702
return
694703
}
695704
if (targetIssue.ruleId === CodeWhispererConstants.sasRuleId) {
705+
console.log('GenerateFix is not available for SAS findings.')
696706
getLogger().warn('GenerateFix is not available for SAS findings.')
697707
return
698708
}
@@ -732,6 +742,9 @@ export const generateFix = Commands.declare(
732742
getLogger().debug(
733743
`Received fix with reference and user settings disallow references. Job ID: ${jobId}`
734744
)
745+
console.log(
746+
`Received fix with reference and user settings disallow references. Job ID: ${jobId}`
747+
)
735748
// TODO: re-enable notifications once references published
736749
// void vscode.window.showInformationMessage(
737750
// 'Your settings do not allow code generation with references.'
@@ -755,6 +768,7 @@ export const generateFix = Commands.declare(
755768
]
756769
: [],
757770
}
771+
console.log('finish updating issue', updatedIssue)
758772
await updateSecurityIssueWebview({
759773
issue: updatedIssue,
760774
isGenerateFixLoading: false,
@@ -765,6 +779,7 @@ export const generateFix = Commands.declare(
765779

766780
SecurityIssueProvider.instance.updateIssue(updatedIssue, targetFilePath)
767781
SecurityIssueTreeViewProvider.instance.refresh()
782+
console.log('finish updating webview')
768783
} catch (err) {
769784
const error = err instanceof Error ? err : new TypeError('Unexpected error')
770785
await updateSecurityIssueWebview({

0 commit comments

Comments
 (0)