diff --git a/rider-fsharp/src/main/java/com/jetbrains/rider/plugins/fsharp/services/fsi/SendToFsiActions.kt b/rider-fsharp/src/main/java/com/jetbrains/rider/plugins/fsharp/services/fsi/SendToFsiActions.kt index acedcaf4a3..619a7f6991 100644 --- a/rider-fsharp/src/main/java/com/jetbrains/rider/plugins/fsharp/services/fsi/SendToFsiActions.kt +++ b/rider-fsharp/src/main/java/com/jetbrains/rider/plugins/fsharp/services/fsi/SendToFsiActions.kt @@ -10,7 +10,6 @@ import com.intellij.openapi.util.Iconable import com.intellij.openapi.util.SystemInfo import com.intellij.psi.PsiElement import com.jetbrains.rd.platform.util.getComponent -import com.jetbrains.rider.ideaInterop.fileTypes.fsharp.FSharpLanguageBase import icons.ReSharperIcons import javax.swing.Icon @@ -41,6 +40,8 @@ open class SendToFsiActionBase( private val sendSelectionText: String ) : AnAction(), DumbAware { + override fun getActionUpdateThread() = ActionUpdateThread.BGT + override fun actionPerformed(e: AnActionEvent) { val editor = CommonDataKeys.EDITOR.getData(e.dataContext)!! val file = CommonDataKeys.PSI_FILE.getData(e.dataContext)!! @@ -55,9 +56,9 @@ open class SendToFsiActionBase( e.presentation.isVisible = false return } - val file = CommonDataKeys.PSI_FILE.getData(e.dataContext) + CommonDataKeys.PSI_FILE.getData(e.dataContext) val editor = CommonDataKeys.EDITOR.getData(e.dataContext) - if (file?.language !is FSharpLanguageBase || editor?.caretModel?.caretCount != 1) { + if (editor?.caretModel?.caretCount != 1) { e.presentation.isEnabled = false return } @@ -99,7 +100,7 @@ abstract class BaseSendToFsiIntentionAction(private val debug: Boolean, private override fun startInWriteAction() = false override fun isAvailable(project: Project, editor: Editor?, file: PsiElement) = - isAvailable && file.language is FSharpLanguageBase && editor?.caretModel?.caretCount == 1 + isAvailable && editor?.caretModel?.caretCount == 1 override fun invoke(project: Project, editor: Editor, element: PsiElement) { project.getComponent().sendToFsi(editor, element.containingFile, debug) diff --git a/rider-fsharp/src/main/resources/META-INF/plugin.xml b/rider-fsharp/src/main/resources/META-INF/plugin.xml index 98e6e2dfb2..3ded2c5ee5 100644 --- a/rider-fsharp/src/main/resources/META-INF/plugin.xml +++ b/rider-fsharp/src/main/resources/META-INF/plugin.xml @@ -62,24 +62,28 @@ com.jetbrains.rider.plugins.fsharp.services.fsi.SendLineToFsiIntentionAction F# + F# SendToFsi com.jetbrains.rider.plugins.fsharp.services.fsi.SendSelectionToFsiIntentionAction F# + F# SendToFsi com.jetbrains.rider.plugins.fsharp.services.fsi.DebugLineInFsiIntentionAction F# + F# SendToFsi com.jetbrains.rider.plugins.fsharp.services.fsi.DebugSelectionInFsiIntentionAction F# + F# SendToFsi