Logging of the reason of highlighting cancelled for WaitForFinishedCodeAnalysis

GitOrigin-RevId: 87bf64323264d2ea6b0c1a759d164a3482ad53c7
This commit is contained in:
Alexey Kryuchkov
2024-06-18 02:31:36 +04:00
committed by intellij-monorepo-bot
parent ff85a4fbe2
commit 0d546ea6a4

View File

@@ -113,7 +113,11 @@ class ListenerState(val project: Project, val cs: CoroutineScope) {
locked = false locked = false
} }
else { 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 }}") 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") 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 { private class SimpleEditedDocumentsListener(private val project: Project) : BulkAwareDocumentListener.Simple {