From 9bafb340515ed796477810cdac6df5804ab4ef63 Mon Sep 17 00:00:00 2001 From: Alexey Kryuchkov Date: Mon, 14 Apr 2025 17:52:30 +0400 Subject: [PATCH] Replace the new line in the highlight description for StoreHighlightingResultsCommand GitOrigin-RevId: f911bc18edb4c2b822681f3b023f78db1ed0f718 --- .../commands/StoreHighlightingResultsCommand.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/StoreHighlightingResultsCommand.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/StoreHighlightingResultsCommand.kt index ea7634c51483..8472326d8dfe 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/StoreHighlightingResultsCommand.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/StoreHighlightingResultsCommand.kt @@ -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") } } }