Unify usage of ProgressManager.progressIndicator
This commit is contained in:
@@ -18,6 +18,9 @@ package org.jetbrains.kotlin.idea.util.application
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.command.CommandProcessor
|
||||
import com.intellij.openapi.progress.ProgressIndicator
|
||||
import com.intellij.openapi.progress.ProgressIndicatorProvider
|
||||
import com.intellij.openapi.progress.ProgressManager
|
||||
import com.intellij.openapi.project.Project
|
||||
|
||||
fun <T> runReadAction(action: () -> T): T {
|
||||
@@ -41,4 +44,10 @@ fun <T> Project.executeCommand(name: String, groupId: Any? = null, command: () -
|
||||
CommandProcessor.getInstance().executeCommand(this, { result = command() }, name, groupId)
|
||||
@Suppress("USELESS_CAST")
|
||||
return result as T
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ProgressManager.getProgressIndicator() is nullable in 181 and dynamic again in 182
|
||||
* BUNCH: 181
|
||||
*/
|
||||
val ProgressManager.progressIndicatorNullable: ProgressIndicator? get() = progressIndicator
|
||||
Reference in New Issue
Block a user