@RequiresBlockingContext
注解)的 Kotlin 协程中方法的不当用法。
这些方法中的许多方法都有对应的协程友好型替代,可以在 suspend
上下文中使用。
示例:
com.intellij.openapi.progress.ProgressManager.checkCanceled()
应被替换为 com.intellij.openapi.progress.checkCancelled()
com.intellij.openapi.application.Application.invokeAndWait()
应被替换为 withContext(Dispatchers.EDT)