WaitForFinishedCodeAnalysis: clean up yellow code, no semantic changes

GitOrigin-RevId: bf85c73b979a897992a83313fbe5fee5942e957a
This commit is contained in:
Elena Shaverdova
2024-06-26 22:06:08 +02:00
committed by intellij-monorepo-bot
parent 63542cbe59
commit 6bf061301d

View File

@@ -97,6 +97,7 @@ class ListenerState(val project: Project, val cs: CoroutineScope) {
private fun ensureLockedIfNeeded() { private fun ensureLockedIfNeeded() {
synchronized(stateLock) { synchronized(stateLock) {
@Suppress("UsePropertyAccessSyntax") // inhibit weak warning, for property access is a warning
if (!sessions.isEmpty() && !locked) { if (!sessions.isEmpty() && !locked) {
LOG.info("Highlighting began with ${sessions.keys.joinToString(separator = ",\n") { it.description }}") LOG.info("Highlighting began with ${sessions.keys.joinToString(separator = ",\n") { it.description }}")
highlightingFinishedEverywhere.acquire() highlightingFinishedEverywhere.acquire()
@@ -111,6 +112,7 @@ class ListenerState(val project: Project, val cs: CoroutineScope) {
return return
} }
@Suppress("UsePropertyAccessSyntax") // inhibit weak warning, for property access is a warning
if (sessions.isEmpty()) { if (sessions.isEmpty()) {
LOG.info("Highlighting done") LOG.info("Highlighting done")
LOG.info("Total opening time is : ${Duration.ofNanos(System.nanoTime() - StartUpMeasurer.getStartTime()).toMillis()}") LOG.info("Total opening time is : ${Duration.ofNanos(System.nanoTime() - StartUpMeasurer.getStartTime()).toMillis()}")
@@ -118,9 +120,9 @@ class ListenerState(val project: Project, val cs: CoroutineScope) {
locked = false locked = false
} }
else { else {
//Printing additional information to get information why huglighting was stucked //Printing additional information to get information why highlighting was stuck
sessions.forEach { sessions.forEach {
printCodeAnalyzerStatistis(it.key.editor) printCodeAnalyzerStatistic(it.key.editor)
printFileStatus(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 }}")
@@ -253,7 +255,7 @@ class ListenerState(val project: Project, val cs: CoroutineScope) {
} }
} }
private fun printCodeAnalyzerStatistis(editor: Editor) { private fun printCodeAnalyzerStatistic(editor: Editor) {
try { try {
ReadAction.run<Throwable> { ReadAction.run<Throwable> {
LOG.info("Analyzer status for ${editor.virtualFile.path}\n ${TrafficLightRenderer(project, editor.document).daemonCodeAnalyzerStatus}") LOG.info("Analyzer status for ${editor.virtualFile.path}\n ${TrafficLightRenderer(project, editor.document).daemonCodeAnalyzerStatus}")
@@ -271,7 +273,7 @@ class ListenerState(val project: Project, val cs: CoroutineScope) {
.toString(editor.document) .toString(editor.document)
LOG.info("File status map $fileStatus") LOG.info("File status map $fileStatus")
} }
catch (throwable: Throwable) { catch (_: Throwable) {
LOG.warn("Print Analyzer status map failed") LOG.warn("Print Analyzer status map failed")
} }
} }