Allow to throw plugin exception when plugin version is patched
This commit is contained in:
@@ -136,9 +136,6 @@
|
|||||||
<action id="StoredExceptionsThrowToggleAction" class="org.jetbrains.kotlin.idea.actions.internal.StoredExceptionsThrowToggleAction"
|
<action id="StoredExceptionsThrowToggleAction" class="org.jetbrains.kotlin.idea.actions.internal.StoredExceptionsThrowToggleAction"
|
||||||
text="Throw cached PCE"/>
|
text="Throw cached PCE"/>
|
||||||
|
|
||||||
<action id="KotlinThrowException" class="org.jetbrains.kotlin.idea.actions.internal.KotlinThrowExceptionAction"
|
|
||||||
text="Throw Kotlin Plugin Exception"/>
|
|
||||||
|
|
||||||
<action id="CopyAsDiagnosticTest" class="org.jetbrains.kotlin.idea.actions.internal.CopyAsDiagnosticTestAction"
|
<action id="CopyAsDiagnosticTest" class="org.jetbrains.kotlin.idea.actions.internal.CopyAsDiagnosticTestAction"
|
||||||
text="Copy Current File As Diagnostic Test"/>
|
text="Copy Current File As Diagnostic Test"/>
|
||||||
|
|
||||||
@@ -153,6 +150,9 @@
|
|||||||
<add-to-group group-id="Internal" anchor="last"/>
|
<add-to-group group-id="Internal" anchor="last"/>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
<action id="KotlinThrowException" class="org.jetbrains.kotlin.idea.actions.internal.KotlinThrowExceptionAction"
|
||||||
|
text="Throw Kotlin Plugin Exception"/>
|
||||||
|
|
||||||
<action id="ExtractFunctionToScope" class="org.jetbrains.kotlin.idea.refactoring.introduce.extractFunction.ExtractFunctionToScopeAction"
|
<action id="ExtractFunctionToScope" class="org.jetbrains.kotlin.idea.refactoring.introduce.extractFunction.ExtractFunctionToScopeAction"
|
||||||
text="Function to _Scope...">
|
text="Function to _Scope...">
|
||||||
<keyboard-shortcut keymap="$default" first-keystroke="control alt shift M"/>
|
<keyboard-shortcut keymap="$default" first-keystroke="control alt shift M"/>
|
||||||
|
|||||||
@@ -7,8 +7,16 @@ package org.jetbrains.kotlin.idea.actions.internal
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.AnAction
|
import com.intellij.openapi.actionSystem.AnAction
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
|
import com.intellij.openapi.application.ApplicationManager
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinPluginUtil
|
||||||
|
|
||||||
class KotlinThrowExceptionAction : AnAction() {
|
class KotlinThrowExceptionAction : AnAction() {
|
||||||
|
override fun update(e: AnActionEvent) {
|
||||||
|
super.update(e)
|
||||||
|
|
||||||
|
e.presentation.isEnabledAndVisible = KotlinPluginUtil.isPatched() || ApplicationManager.getApplication().isInternal
|
||||||
|
}
|
||||||
|
|
||||||
override fun actionPerformed(e: AnActionEvent) {
|
override fun actionPerformed(e: AnActionEvent) {
|
||||||
throw IllegalStateException("Kotlin Test Exception")
|
throw IllegalStateException("Kotlin Test Exception")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user