Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/realtimeScanners/scanners/secrets/secretsScannerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,23 +133,27 @@ export class SecretsScannerService extends BaseScannerService {
const key = `${entry.PackageName}:${entry.secretValue}:${relativePath}`;
const lines = secretLocations.get(key) || [];

lines.forEach(line => {
const adjustedLine = line;
// Only show gutter icon on the first line of multi-line secrets
if (lines.length > 0) {
const firstLine = lines[0];
const range = new vscode.Range(
new vscode.Position(adjustedLine, 0),
new vscode.Position(adjustedLine, 1000)
new vscode.Position(firstLine, 0),
new vscode.Position(firstLine, 1000)
);
ignoredDecorations.push({ range });
}

const hoverKey = `${filePath}:${adjustedLine}`;
// But keep hover data for all lines so users can hover anywhere
lines.forEach(line => {
const hoverKey = `${filePath}:${line}`;
if (!this.secretsHoverData.has(hoverKey)) {
this.secretsHoverData.set(hoverKey, {
title: entry.PackageName,
description: entry.description,
severity: entry.severity,
secretValue: entry.secretValue,
filePath,
location: { line: adjustedLine, startIndex: 0, endIndex: 1000 }
location: { line: line, startIndex: 0, endIndex: 1000 }
});
}
});
Expand Down
Loading