Having trouble getting my custom action to show up in debug/run mode.

I have a created a quick action class:

public class TestGen extends AnAction {

@Override
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(PlatformDataKeys.PROJECT);
String txt = Messages.showInputDialog(project,"test,","Test",Messages.getQuestionIcon());
Messages.showMessageDialog(project,"hello, " + txt + "\n test","Test",Messages.getInformationIcon());
}
}
and also created the action using the create action dialog but when I run in debug mode my action will not show up in the tools menu.
The plugin.xml is correct too:
<actions>
<!-- Add your actions here -->
<action id="TestGen" class="TestGen" text="TestGen" description="TestGen">
<add-to-group group-id="ToolsMenu" anchor="before" relative-to-action="PsiViewer"/>
</action>
</actions>
Any help would be much appreciated. This is using Java 8 fyi.

1
3 comments

Do you have any error messages in console or idea.log?

0
Avatar
Permanently deleted user

Yes. 

console.

/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60356,suspend=y,server=n -Xmx512m -Xms256m -XX:MaxPermSize=250m -ea "-Xbootclasspath/a:/Applications/IntelliJ IDEA CE.app/Contents/lib/boot.jar" -Didea.config.path=/Users/christopherkim/Library/Caches/IdeaIC2016.1/plugins-sandbox/config -Didea.system.path=/Users/christopherkim/Library/Caches/IdeaIC2016.1/plugins-sandbox/system -Didea.plugins.path=/Users/christopherkim/Library/Caches/IdeaIC2016.1/plugins-sandbox/plugins -Didea.classpath.index.enabled=false -Didea.required.plugins.id=com.your.company.unique.plugin.id -Didea.smooth.progress=false -Dapple.laf.useScreenMenuBar=true -Didea.platform.prefix=Idea -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/lib/tools.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/bootstrap.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/extensions.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/util.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/openapi.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/trove4j.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/jdom.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/log4j.jar" com.intellij.idea.Main
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=250m; support was removed in 8.0
Connected to the target VM, address: '127.0.0.1:60356', transport: 'socket'
/Applications/IntelliJ IDEA CE.app/Contents/bin/idea.properties: 'idea.smooth.progress' already defined
/Applications/IntelliJ IDEA CE.app/Contents/bin/idea.properties: 'java.endorsed.dirs' already defined
/Applications/IntelliJ IDEA CE.app/Contents/bin/idea.properties: 'apple.laf.useScreenMenuBar' already defined
[ 11109] WARN - j.ui.mac.MacMainFrameDecorator - no url bundle present.
To use platform protocol handler to open external links specify required protocols in the mac app layout section of the build file
Example: args.urlSchemes = ["your-protocol"] will handle following links: your-protocol://open?file=file&line=line
[ 12559] WARN - .intellij.diagnostic.VMOptions - VM options file path missing

-------

idea.log

2016-07-08 13:55:00,798 [ 11109] WARN - j.ui.mac.MacMainFrameDecorator - no url bundle present.
To use platform protocol handler to open external links specify required protocols in the mac app layout section of the build file
Example: args.urlSchemes = ["your-protocol"] will handle following links: your-protocol://open?file=file&line=line
2016-07-08 13:55:02,248 [ 12559] WARN - .intellij.diagnostic.VMOptions - VM options file path missing

0

Looks like you use the default plugin id in plugin.xml file (com.your.company.unique.plugin.id). Probably this causes the problem (e.g. you may have the two plugins with this id and only one of them is loaded). Please try to change 'id' and 'name' tags in plugin.xml to something more specific, then start IDEA and check that the plugin is really loaded (i.e. it's shown in Settings | Plugins).

0

Please sign in to leave a comment.