mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
Logging for highlighting test commands
GitOrigin-RevId: cf3acbd65820257b30579013558128822f0a0b1f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3c247f867f
commit
174e018654
@@ -313,7 +313,8 @@ internal class WaitForFinishedCodeAnalysisListener(private val project: Project)
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun daemonStopped(fileEditors: Collection<FileEditor>, isCancelled: Boolean) {
|
private fun daemonStopped(fileEditors: Collection<FileEditor>, 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()
|
val worthy = fileEditors.getWorthy()
|
||||||
if (worthy.isEmpty()) return
|
if (worthy.isEmpty()) return
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jetbrains.performancePlugin.utils
|
package com.jetbrains.performancePlugin.utils
|
||||||
|
|
||||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
|
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
|
||||||
|
import com.intellij.openapi.diagnostic.logger
|
||||||
import com.intellij.openapi.fileEditor.FileEditor
|
import com.intellij.openapi.fileEditor.FileEditor
|
||||||
import com.intellij.openapi.util.Ref
|
import com.intellij.openapi.util.Ref
|
||||||
import com.intellij.util.messages.SimpleMessageBusConnection
|
import com.intellij.util.messages.SimpleMessageBusConnection
|
||||||
@@ -11,6 +12,9 @@ import java.util.concurrent.CompletableFuture
|
|||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
internal object DaemonCodeAnalyzerListener {
|
internal object DaemonCodeAnalyzerListener {
|
||||||
|
|
||||||
|
val LOG = logger<DaemonCodeAnalyzerListener>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen to the SimpleMessageBusConnection to receive notifications when the daemon finishes.
|
* Listen to the SimpleMessageBusConnection to receive notifications when the daemon finishes.
|
||||||
*
|
*
|
||||||
@@ -27,6 +31,7 @@ internal object DaemonCodeAnalyzerListener {
|
|||||||
val result = DaemonCodeAnalyzerResult(connection, spanRef, timeoutInSeconds)
|
val result = DaemonCodeAnalyzerResult(connection, spanRef, timeoutInSeconds)
|
||||||
connection.subscribe(DaemonCodeAnalyzer.DAEMON_EVENT_TOPIC, object : DaemonCodeAnalyzer.DaemonListener {
|
connection.subscribe(DaemonCodeAnalyzer.DAEMON_EVENT_TOPIC, object : DaemonCodeAnalyzer.DaemonListener {
|
||||||
override fun daemonFinished(fileEditors: Collection<FileEditor>) {
|
override fun daemonFinished(fileEditors: Collection<FileEditor>) {
|
||||||
|
printFinishedAnalyzers(fileEditors)
|
||||||
if (expectedOpenedFile == null) {
|
if (expectedOpenedFile == null) {
|
||||||
result.release()
|
result.release()
|
||||||
}
|
}
|
||||||
@@ -37,6 +42,15 @@ internal object DaemonCodeAnalyzerListener {
|
|||||||
})
|
})
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun printFinishedAnalyzers(fileEditors: Collection<FileEditor>) {
|
||||||
|
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,
|
internal class DaemonCodeAnalyzerResult(private val connection: SimpleMessageBusConnection,
|
||||||
|
|||||||
Reference in New Issue
Block a user