Unify usage of ProgressManager.progressIndicator

This commit is contained in:
Nikolay Krasko
2018-04-12 14:29:08 +03:00
parent 1b1e4ab970
commit 2260f66e02
10 changed files with 19 additions and 948 deletions
@@ -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