Skip to content

Commit 8c934f5

Browse files
committed
remove redundant checks
1 parent ab5f905 commit 8c934f5

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
@@ -50,30 +50,30 @@
5050
<projectConfigurable parentId="Errors" instance="com.jetbrains.rider.settings.FSharpInspectionsPage" />
5151

5252
<intentionAction>
53-
<language>F#</language>
5453
<className>com.jetbrains.rider.plugins.fsharp.services.fsi.SendLineToFsiIntentionAction</className>
5554
<category>F#</category>
55+
<language>F#</language>
5656
<descriptionDirectoryName>SendToFsi</descriptionDirectoryName>
5757
</intentionAction>
5858

5959
<intentionAction>
60-
<language>F#</language>
6160
<className>com.jetbrains.rider.plugins.fsharp.services.fsi.SendSelectionToFsiIntentionAction</className>
6261
<category>F#</category>
62+
<language>F#</language>
6363
<descriptionDirectoryName>SendToFsi</descriptionDirectoryName>
6464
</intentionAction>
6565

6666
<intentionAction>
67-
<language>F#</language>
6867
<className>com.jetbrains.rider.plugins.fsharp.services.fsi.DebugLineInFsiIntentionAction</className>
6968
<category>F#</category>
69+
<language>F#</language>
7070
<descriptionDirectoryName>SendToFsi</descriptionDirectoryName>
7171
</intentionAction>
7272

7373
<intentionAction>
74-
<language>F#</language>
7574
<className>com.jetbrains.rider.plugins.fsharp.services.fsi.DebugSelectionInFsiIntentionAction</className>
7675
<category>F#</category>
76+
<language>F#</language>
7777
<descriptionDirectoryName>SendToFsi</descriptionDirectoryName>
7878
</intentionAction>
7979

0 commit comments

Comments
 (0)