From aaecc987a7f1fb30b89ef26c71a526a6aff958d0 Mon Sep 17 00:00:00 2001 From: Louis Vignier Date: Fri, 1 Mar 2024 15:43:29 +0100 Subject: [PATCH] [codeInsight] Add isUnitTestMode assertion to InlayHintsUtils#computeCodeVisionUnderReadAction IJ-CR-126922 GitOrigin-RevId: adddbe1a000be7528eb76614983e2a201f04232c --- .../src/com/intellij/codeInsight/hints/InlayHintsUtils.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/InlayHintsUtils.kt b/platform/lang-impl/src/com/intellij/codeInsight/hints/InlayHintsUtils.kt index 8e7208119cf2..51cf29f79a91 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/InlayHintsUtils.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/InlayHintsUtils.kt @@ -7,6 +7,7 @@ import com.intellij.configurationStore.deserializeInto import com.intellij.configurationStore.serialize import com.intellij.lang.Language import com.intellij.openapi.actionSystem.AnAction +import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.ReadAction import com.intellij.openapi.editor.DefaultLanguageHighlighterColors import com.intellij.openapi.editor.Editor @@ -295,6 +296,7 @@ object InlayHintsUtils { } else { // In tests [computeCodeVision] is executed in sync mode on EDT + assert(ApplicationManager.getApplication().isUnitTestMode) return ReadAction.compute { return@compute computable.invoke() }