Our plugin show context menu on any folder or file in project. It's really weird and this behaviour may provide runtime errors.
We need to show button if and only if user right-click on .kt file.
I had tried to do that using
override fun update(e: AnActionEvent) {
super.update(e)
val virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE)
e.presentation.isEnabledAndVisible = virtualFile != null
}
But I couldn't succeed. If you know how to accomplish it, please help me by submitting a pull request or replying on my Stack Overflow question.
Our plugin show context menu on any folder or file in project. It's really weird and this behaviour may provide runtime errors. We need to show button if and only if user right-click on .kt file.
I had tried to do that using
But I couldn't succeed. If you know how to accomplish it, please help me by submitting a pull request or replying on my Stack Overflow question.