Skip to content

Commit 6583a32

Browse files
authored
fix(amazonq): update filter condition to remove diagnostic (#5017)
1 parent 0f9782a commit 6583a32

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,13 @@ export function removeDiagnostic(uri: vscode.Uri, issue: CodeScanIssue) {
128128
const currentSecurityDiagnostics = securityScanRender.securityDiagnosticCollection?.get(uri)
129129
if (currentSecurityDiagnostics) {
130130
const newSecurityDiagnostics = currentSecurityDiagnostics.filter(diagnostic => {
131-
return (
131+
return !(
132132
typeof diagnostic.code !== 'string' &&
133133
typeof diagnostic.code !== 'number' &&
134-
diagnostic.code?.value !== issue.detectorId &&
135-
diagnostic.message !== issue.title &&
136-
diagnostic.range !== new vscode.Range(issue.startLine, 0, issue.endLine, 0)
134+
diagnostic.code?.value === issue.detectorId &&
135+
diagnostic.message === issue.title &&
136+
diagnostic.range.start.line === issue.startLine &&
137+
diagnostic.range.end.line === issue.endLine
137138
)
138139
})
139140
securityScanRender.securityDiagnosticCollection?.set(uri, newSecurityDiagnostics)

0 commit comments

Comments
 (0)