Custom action for specific file type on an existing shortcut Follow
Answered
Hi there,
I have a plugin that provides support for a query language, similar to SQL. I want to support query execution on Ctrl+Enter on the active editor, instead of the SplitLine action.
Here is how it's configured in plugin.xml:
<action id="com.example.ExecuteQueryAction"
class="com.example.ExecuteQueryAction"
text="Execute" description="Execute" popup="true" use-shortcut-of="EditorSplitLine">
<add-to-group group-id="EditorPopupMenu.Run" anchor="first"/>
<add-to-group group-id="rdfandsparql.QueryEditorHeaderToolbar" anchor="first"/>
<keyboard-shortcut first-keystroke="control ENTER" keymap="$default"/>
</action>
It works fine until the 212.x and older versions of the SDK. Not sure what has changed in the SDK, but nothing has changed in my code. Anyways, it could be that prior the 212.x version it works because of a bug in the SDK or something else.
How to implement such functionality correctly, so that it works in all versions or at least in the 212.x and older ones?
Regards,
Maksim
Please sign in to leave a comment.
Specifying both use-shortcut-of and explicit <keyboard-shortcut> seems contradicting?
Hi Yann! Maybe, but none of the combinations of these instructions actually helps. It works in the 211.x and before, but not after.
Okay, I got it. I forgot that I have the ActionPromoter implemented for Ctrl+Enter. Also, I noticed that starting from the 212.x they introduced the `suppress` method in there, therefore I guess the behaviour of the ActionPromoter has changed actually.
In short, I've updated the implementation of the ActionPromoter to fix the issue.