Skip to content

Commit 6bc3ee1

Browse files
committed
Get rid of "Override-only method usage violation"
1 parent 8761f7a commit 6bc3ee1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/main/kotlin/io/vlang/ide/intentions/VlangImplementInterfaceIntention.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.vlang.ide.intentions
22

33
import com.intellij.codeInsight.intention.HighPriorityAction
44
import com.intellij.openapi.actionSystem.*
5+
import com.intellij.openapi.actionSystem.ex.ActionUtil
56
import com.intellij.openapi.application.ApplicationManager
67
import com.intellij.openapi.editor.Editor
78
import com.intellij.openapi.editor.ex.util.EditorUtil
@@ -24,16 +25,15 @@ class VlangImplementInterfaceIntention : VlangBaseIntention(), HighPriorityActio
2425
}
2526

2627
override operator fun invoke(project: Project, editor: Editor, element: PsiElement) {
27-
val action = findImplementMethodsAction()
28-
action?.actionPerformed(
29-
AnActionEvent.createEvent(
30-
EditorUtil.getEditorDataContext(editor),
31-
null,
32-
ActionPlaces.UNKNOWN,
33-
ActionUiKind.NONE,
34-
null,
35-
)
28+
val action = findImplementMethodsAction() ?: return
29+
val event = AnActionEvent.createEvent(
30+
EditorUtil.getEditorDataContext(editor),
31+
null,
32+
ActionPlaces.UNKNOWN,
33+
ActionUiKind.NONE,
34+
null,
3635
)
36+
ActionUtil.performAction(action, event)
3737
}
3838

3939
override fun getShortcut(): ShortcutSet? {

0 commit comments

Comments
 (0)