From 0d546ea6a419c7cb168bc3633937a826d4a91b7c Mon Sep 17 00:00:00 2001 From: Alexey Kryuchkov Date: Tue, 18 Jun 2024 02:31:36 +0400 Subject: [PATCH] Logging of the reason of highlighting cancelled for WaitForFinishedCodeAnalysis GitOrigin-RevId: 87bf64323264d2ea6b0c1a759d164a3482ad53c7 --- .../commands/WaitForFinishedCodeAnalysis.kt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt index e338fb11ff05..8ed70071f648 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt @@ -113,7 +113,11 @@ class ListenerState(val project: Project, val cs: CoroutineScope) { locked = false } else { - sessions.forEach { printCodeAnalyzerStatistis(it.key.editor) } + //Printing additional information to get information why huglighting was stucked + sessions.forEach { + printCodeAnalyzerStatistis(it.key.editor) + printFileStatus(it.key.editor) + } LOG.info("Highlighting still in progress: ${sessions.keys.joinToString(separator = ",\n") { it.description }}") } } @@ -254,6 +258,19 @@ class ListenerState(val project: Project, val cs: CoroutineScope) { LOG.warn("Print Analyzer status failed") } } + + internal fun printFileStatus(editor: Editor) { + try { + val fileStatus = (DaemonCodeAnalyzerImpl.getInstance(project) as DaemonCodeAnalyzerImpl) + .fileStatusMap + .toString(editor.document) + LOG.info("File status map $fileStatus") + } + catch (throwable: Throwable) { + LOG.warn("Print Analyzer status map failed") + } + } + } private class SimpleEditedDocumentsListener(private val project: Project) : BulkAwareDocumentListener.Simple {