plugin.xml action shortcut works on windows, but don't work on mac

Answered

Hello, face the problem when described in plugin.xml action shortcut, works on windows, but don't work on mac.

 

<actions>

<action id="gorepogen.intellij.plugin.GenerateAction"

class="gorepogen.intellij.plugin.GenerateAction"

text="Generate Repository">

<add-to-group group-id="CodeMenu" anchor="after" relative-to-action="Generate"/>

<keyboard-shortcut keymap="$default" first-keystroke="alt G"/>

</action>

</actions>

 

Code section dropdown also not work on mac, when i click on it, just blink happens, instead of dropdown showing.

0
8 comments

I cannot reproduce your issue - your actions definition is correct and works fine on Mac:

 

 

After invoking assigned actions, it stops on the breakpoint correctly.

0

Example of how it happens on my mac:

 

Mac version: Catalina 10.15.3 (19D76)

IDEA version: IntelliJ IDEA 2019.3.3 (Ultimate Edition)
IDEA build: Build #IU-193.6494.35, built on February 11, 2020

0

Having exactly the same IDE build, and OS version - in full screen as well - everything behaves correctly and Code menu appears and stays as it should.

Maybe there is something wrong with your Action's implementation of update method?

0

Btw, it perfectly works on windows. To be honest, i have only actionPerformed method implemented:

class GenerateAction : AnAction() {
override fun actionPerformed(event: AnActionEvent) {

val entityName = event.getData(PlatformDataKeys.EDITOR)?.selectionModel?.selectedText
if (entityName == null) {
MessageUtil.showHighlightEntityErrorMessage(event.project!!)
}

try {

FileUtil.save(event.getData(PlatformDataKeys.EDITOR)!!.document)

MessageUtil.showSuccessMessage(
event.project!!,
GenerationService.instance.generateFor(entityName!!, event.project!!.basePath!!)
)
} catch (ex: NotFoundException) {
MessageUtil.showDownloadAndInstallDialog(event.project!!)
}

}
}
0

Thank you sir for help. I found what was the problem.

0

Could you please describe your solution and where the problem come from? So fellow plugin developers will be noticed...

0

Sure, problem was really stupid, but.. it was because of localised resource bundles. 

I have messages_en_US.properties, on Windows locale was US, but on my Mac it was GB. So, because of that it work not as expected.

I just remove locale, and leave bundle just as messages.properties. Now it works as expected. CodeMenu dropdown open correctly.

2

Please sign in to leave a comment.