@@ -25,30 +25,34 @@ export class SecurityIssueHoverProvider extends SecurityIssueProvider implements
2525 ) : vscode . Hover {
2626 const contents : vscode . MarkdownString [ ] = [ ]
2727
28- const fileIssues = this . issues . find ( ( group ) => group . filePath === document . fileName ) ?. issues || [ ]
29-
30- for ( const issue of fileIssues ) {
31- const range = new vscode . Range ( issue . startLine , 0 , issue . endLine , 0 )
32- if ( range . contains ( position ) ) {
33- contents . push ( this . _getContent ( document . fileName , issue ) )
34- telemetry . codewhisperer_codeScanIssueHover . emit ( {
35- findingId : issue . findingId ,
36- detectorId : issue . detectorId ,
37- ruleId : issue . ruleId ,
38- includesFix : ! ! issue . suggestedFixes . length ,
39- credentialStartUrl : AuthUtil . instance . startUrl ,
40- } )
41- TelemetryHelper . instance . sendCodeScanRemediationsEvent (
42- document . languageId ,
43- 'CODESCAN_ISSUE_HOVER' ,
44- issue . detectorId ,
45- issue . findingId ,
46- issue . ruleId ,
47- undefined ,
48- undefined ,
49- undefined ,
50- ! ! issue . suggestedFixes . length
51- )
28+ for ( const group of this . issues ) {
29+ if ( document . fileName !== group . filePath ) {
30+ continue
31+ }
32+
33+ for ( const issue of group . issues ) {
34+ const range = new vscode . Range ( issue . startLine , 0 , issue . endLine , 0 )
35+ if ( range . contains ( position ) ) {
36+ contents . push ( this . _getContent ( group . filePath , issue ) )
37+ telemetry . codewhisperer_codeScanIssueHover . emit ( {
38+ findingId : issue . findingId ,
39+ detectorId : issue . detectorId ,
40+ ruleId : issue . ruleId ,
41+ includesFix : ! ! issue . suggestedFixes . length ,
42+ credentialStartUrl : AuthUtil . instance . startUrl ,
43+ } )
44+ TelemetryHelper . instance . sendCodeScanRemediationsEvent (
45+ document . languageId ,
46+ 'CODESCAN_ISSUE_HOVER' ,
47+ issue . detectorId ,
48+ issue . findingId ,
49+ issue . ruleId ,
50+ undefined ,
51+ undefined ,
52+ undefined ,
53+ ! ! issue . suggestedFixes . length
54+ )
55+ }
5256 }
5357 }
5458
0 commit comments