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 aafa3706902f..74a85c069b1c 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt @@ -313,7 +313,8 @@ internal class WaitForFinishedCodeAnalysisListener(private val project: Project) } private fun daemonStopped(fileEditors: Collection, isCancelled: Boolean) { - ListenerState.LOG.info("daemon stopped with ${fileEditors.size} unfiltered editors") + val status = if(isCancelled) "cancelled" else "stopped" + ListenerState.LOG.info("daemon $status with ${fileEditors.size} unfiltered editors") val worthy = fileEditors.getWorthy() if (worthy.isEmpty()) return diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/utils/DaemonCodeAnalyzerListener.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/utils/DaemonCodeAnalyzerListener.kt index 623839ae2c9b..4b2c569ce00c 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/utils/DaemonCodeAnalyzerListener.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/utils/DaemonCodeAnalyzerListener.kt @@ -1,6 +1,7 @@ package com.jetbrains.performancePlugin.utils import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer +import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.fileEditor.FileEditor import com.intellij.openapi.util.Ref import com.intellij.util.messages.SimpleMessageBusConnection @@ -11,6 +12,9 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.TimeUnit internal object DaemonCodeAnalyzerListener { + + val LOG = logger() + /** * Listen to the SimpleMessageBusConnection to receive notifications when the daemon finishes. * @@ -27,6 +31,7 @@ internal object DaemonCodeAnalyzerListener { val result = DaemonCodeAnalyzerResult(connection, spanRef, timeoutInSeconds) connection.subscribe(DaemonCodeAnalyzer.DAEMON_EVENT_TOPIC, object : DaemonCodeAnalyzer.DaemonListener { override fun daemonFinished(fileEditors: Collection) { + printFinishedAnalyzers(fileEditors) if (expectedOpenedFile == null) { result.release() } @@ -37,6 +42,15 @@ internal object DaemonCodeAnalyzerListener { }) return result } + + private fun printFinishedAnalyzers(fileEditors: Collection) { + try { + fileEditors.forEach { LOG.info("daemonFinished for ${it.file.name}") } + } catch (throwable:Throwable) { + LOG.error("printFinishedAnalyzers failed ${throwable.message}") + } + } + } internal class DaemonCodeAnalyzerResult(private val connection: SimpleMessageBusConnection,