Skip to content

Commit cdd0967

Browse files
committed
remove redundant checks
1 parent 78ae86f commit cdd0967

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

rider-fsharp/src/main/java/com/jetbrains/rider/plugins/fsharp/services/fsi/SendToFsiActions.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import com.intellij.openapi.util.Iconable
1010
import com.intellij.openapi.util.SystemInfo
1111
import com.intellij.psi.PsiElement
1212
import com.jetbrains.rd.platform.util.getComponent
13-
import com.jetbrains.rider.ideaInterop.fileTypes.fsharp.FSharpLanguageBase
1413
import icons.ReSharperIcons
1514
import javax.swing.Icon
1615

@@ -55,9 +54,9 @@ open class SendToFsiActionBase(
5554
e.presentation.isVisible = false
5655
return
5756
}
58-
val file = CommonDataKeys.PSI_FILE.getData(e.dataContext)
57+
CommonDataKeys.PSI_FILE.getData(e.dataContext)
5958
val editor = CommonDataKeys.EDITOR.getData(e.dataContext)
60-
if (file?.language !is FSharpLanguageBase || editor?.caretModel?.caretCount != 1) {
59+
if (editor?.caretModel?.caretCount != 1) {
6160
e.presentation.isEnabled = false
6261
return
6362
}
@@ -99,7 +98,7 @@ abstract class BaseSendToFsiIntentionAction(private val debug: Boolean, private
9998
override fun startInWriteAction() = false
10099

101100
override fun isAvailable(project: Project, editor: Editor?, file: PsiElement) =
102-
isAvailable && file.language is FSharpLanguageBase && editor?.caretModel?.caretCount == 1
101+
isAvailable && editor?.caretModel?.caretCount == 1
103102

104103
override fun invoke(project: Project, editor: Editor, element: PsiElement) {
105104
project.getComponent<FsiHost>().sendToFsi(editor, element.containingFile, debug)

rider-fsharp/src/main/resources/META-INF/plugin.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,30 +60,30 @@
6060
<projectConfigurable parentId="Errors" instance="com.jetbrains.rider.settings.FSharpInspectionsPage" />
6161

6262
<intentionAction>
63-
<language>F#</language>
6463
<className>com.jetbrains.rider.plugins.fsharp.services.fsi.SendLineToFsiIntentionAction</className>
6564
<category>F#</category>
65+
<language>F#</language>
6666
<descriptionDirectoryName>SendToFsi</descriptionDirectoryName>
6767
</intentionAction>
6868

6969
<intentionAction>
70-
<language>F#</language>
7170
<className>com.jetbrains.rider.plugins.fsharp.services.fsi.SendSelectionToFsiIntentionAction</className>
7271
<category>F#</category>
72+
<language>F#</language>
7373
<descriptionDirectoryName>SendToFsi</descriptionDirectoryName>
7474
</intentionAction>
7575

7676
<intentionAction>
77-
<language>F#</language>
7877
<className>com.jetbrains.rider.plugins.fsharp.services.fsi.DebugLineInFsiIntentionAction</className>
7978
<category>F#</category>
79+
<language>F#</language>
8080
<descriptionDirectoryName>SendToFsi</descriptionDirectoryName>
8181
</intentionAction>
8282

8383
<intentionAction>
84-
<language>F#</language>
8584
<className>com.jetbrains.rider.plugins.fsharp.services.fsi.DebugSelectionInFsiIntentionAction</className>
8685
<category>F#</category>
86+
<language>F#</language>
8787
<descriptionDirectoryName>SendToFsi</descriptionDirectoryName>
8888
</intentionAction>
8989

0 commit comments

Comments
 (0)