Skip to content

Commit

Permalink
Override actionupdatethread
Browse files Browse the repository at this point in the history
Signed-off-by: brianneoberson <[email protected]>
  • Loading branch information
brianneoberson committed Dec 12, 2023
1 parent ba666c7 commit 37dcd96
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.amos.pitmutationmate.pitmutationmate.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.psi.PsiClass
Expand Down Expand Up @@ -56,6 +57,10 @@ class ContextMenuAction : RunConfigurationAction() {
e.presentation.isEnabled = shouldEnable
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}

private fun checkCondition(e: AnActionEvent): Boolean {
val psiFile = e.getData(CommonDataKeys.PSI_FILE)
val validFile = psiFile != null && (psiFile.name.endsWith(".java") || psiFile.name.endsWith(".kt"))
Expand Down

0 comments on commit 37dcd96

Please sign in to comment.