Replace the new line in the highlight description for StoreHighlightingResultsCommand

GitOrigin-RevId: f911bc18edb4c2b822681f3b023f78db1ed0f718
This commit is contained in:
Alexey Kryuchkov
2025-04-14 23:34:16 +00:00
committed by intellij-monorepo-bot
parent 26edecf789
commit 9bafb34051
@@ -42,12 +42,15 @@ class StoreHighlightingResultsCommand(text: String, line: Int) : PlaybackCommand
writeIntentReadAction {
val psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.document)
require(psiFile != null)
var description: String
DaemonCodeAnalyzerImpl.getHighlights(editor.document, null, project).forEach { highlight ->
assert(editor.document.textLength > highlight.actualStartOffset) {
"Highlight start offset ${editor.document.textLength} less than document text length ${highlight.actualStartOffset}"
}
description = if (highlight.description == null) "" else highlight.description.replace("\n", "")
fileForStoringHighlights
.appendText("${highlight.severity}☆${highlight.description}☆${editor.document.getLineNumber(highlight.actualStartOffset)}☆${highlight.toolId}" + "\n")
.appendText("${highlight.severity}☆$description☆${editor.document.getLineNumber(highlight.actualStartOffset)}☆${highlight.toolId}" + "\n")
}
}
}