@@ -21,17 +21,41 @@ describe('securityIssueHoverProvider', () => {
21
21
token = new vscode . CancellationTokenSource ( )
22
22
} )
23
23
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 } ')`
26
32
}
27
33
28
34
function buildExpectedContent ( issue : any , fileName : string , description : string , severity ?: string ) : string {
29
35
const severityBadge = severity ? `  } .svg)` : ' '
30
36
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
+ ) ,
35
59
]
36
60
return `## title${ severityBadge } \n${ description } \n\n${ commands . join ( '\n | ' ) } \n`
37
61
}
0 commit comments