Skip to content

Commit 06b4df6

Browse files
fix(amazonq): changed the icon for security issue hover fix option to keep it consistent in all places
1 parent 2770a81 commit 06b4df6

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

packages/amazonq/test/unit/codewhisperer/service/securityIssueHoverProvider.test.ts

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,41 @@ describe('securityIssueHoverProvider', () => {
2121
token = new vscode.CancellationTokenSource()
2222
})
2323

24-
function buildCommandLink(command: string, args: any[], label: string, tooltip: string): string {
25-
return `[$(${command.includes('ignore') ? 'error' : 'comment'}) ${label}](command:${command}?${encodeURIComponent(JSON.stringify(args))} '${tooltip}')`
24+
function buildCommandLink(
25+
command: string,
26+
commandIcon: string,
27+
args: any[],
28+
label: string,
29+
tooltip: string
30+
): string {
31+
return `[$(${commandIcon}) ${label}](command:${command}?${encodeURIComponent(JSON.stringify(args))} '${tooltip}')`
2632
}
2733

2834
function buildExpectedContent(issue: any, fileName: string, description: string, severity?: string): string {
2935
const severityBadge = severity ? ` ![${severity}](severity-${severity.toLowerCase()}.svg)` : ' '
3036
const commands = [
31-
buildCommandLink('aws.amazonq.explainIssue', [issue, fileName], 'Explain', 'Explain with Amazon Q'),
32-
buildCommandLink('aws.amazonq.generateFix', [issue, fileName], 'Fix', 'Fix with Amazon Q'),
33-
buildCommandLink('aws.amazonq.security.ignore', [issue, fileName, 'hover'], 'Ignore', 'Ignore Issue'),
34-
buildCommandLink('aws.amazonq.security.ignoreAll', [issue, 'hover'], 'Ignore All', 'Ignore Similar Issues'),
37+
buildCommandLink(
38+
'aws.amazonq.explainIssue',
39+
'comment',
40+
[issue, fileName],
41+
'Explain',
42+
'Explain with Amazon Q'
43+
),
44+
buildCommandLink('aws.amazonq.generateFix', 'wrench', [issue, fileName], 'Fix', 'Fix with Amazon Q'),
45+
buildCommandLink(
46+
'aws.amazonq.security.ignore',
47+
'error',
48+
[issue, fileName, 'hover'],
49+
'Ignore',
50+
'Ignore Issue'
51+
),
52+
buildCommandLink(
53+
'aws.amazonq.security.ignoreAll',
54+
'error',
55+
[issue, 'hover'],
56+
'Ignore All',
57+
'Ignore Similar Issues'
58+
),
3559
]
3660
return `## title${severityBadge}\n${description}\n\n${commands.join('\n | ')}\n`
3761
}

packages/core/src/codewhisperer/service/securityIssueHoverProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class SecurityIssueHoverProvider implements vscode.HoverProvider {
9090
const generateFixCommand = this._getCommandMarkdown(
9191
'aws.amazonq.generateFix',
9292
[issue, filePath],
93-
'comment',
93+
'wrench',
9494
'Fix',
9595
'Fix with Amazon Q'
9696
)

0 commit comments

Comments
 (0)