Remove unneeded runReadAction in getExceptionMessage

Read action is not needed because at the only call site where we try to
read the PSI element text we do it via `Document.getCharsSequence` which
does not require read action.

 #KT-54971 Fixed
This commit is contained in:
Alexander Udalov
2023-01-02 23:56:14 +01:00
committed by Space Team
parent a0211fc5fe
commit 397cafcbe8
@@ -5,14 +5,12 @@
package org.jetbrains.kotlin.util
import com.intellij.openapi.application.ApplicationManager
fun getExceptionMessage(
subsystemName: String,
message: String,
cause: Throwable?,
location: String?
): String = ApplicationManager.getApplication().runReadAction<String> {
): String =
buildString {
append(subsystemName).append(" Internal error: ").appendLine(message)
@@ -27,4 +25,3 @@ fun getExceptionMessage(
append(cause.stackTrace?.firstOrNull()?.toString() ?: "unknown")
}
}
}