Postpone no kotlin files in selection to CheckComponentsUsageSearch execution (KT-31092)
#KT-31092 Fixed
This commit is contained in:
+4
-4
@@ -39,12 +39,12 @@ import javax.swing.SwingUtilities
|
|||||||
|
|
||||||
class CheckComponentsUsageSearchAction : AnAction() {
|
class CheckComponentsUsageSearchAction : AnAction() {
|
||||||
override fun actionPerformed(e: AnActionEvent) {
|
override fun actionPerformed(e: AnActionEvent) {
|
||||||
val selectedFiles = selectedKotlinFiles(e).toList()
|
val project = CommonDataKeys.PROJECT.getData(e.dataContext) ?: return
|
||||||
val project = CommonDataKeys.PROJECT.getData(e.dataContext)!!
|
val selectedKotlinFiles = selectedKotlinFiles(e).toList()
|
||||||
|
|
||||||
ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
||||||
{
|
{
|
||||||
runReadAction { process(selectedFiles, project) }
|
runReadAction { process(selectedKotlinFiles, project) }
|
||||||
},
|
},
|
||||||
"Checking Data Classes",
|
"Checking Data Classes",
|
||||||
true,
|
true,
|
||||||
@@ -105,7 +105,7 @@ class CheckComponentsUsageSearchAction : AnAction() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
e.presentation.isVisible = true
|
e.presentation.isVisible = true
|
||||||
e.presentation.isEnabled = selectedKotlinFiles(e).any()
|
e.presentation.isEnabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user