1

I'm developing custom plugin for PyCharm in Intellij IDEA Community.

I've change JRE to PyCharm enter image description here

Changed plugin.xml file

<idea-plugin version="2">
  <id>com.krupa.adrian.plugin</id>
  <name>Test plugin</name>
  <version>1.0</version>
  <vendor email="support@yourcompany.com" url="http://www.yourcompany.com">YourCompany</vendor>

  <description><![CDATA[
      Enter short description for your plugin here.<br>
      <em>most HTML tags may be used</em>
    ]]></description>

  <change-notes><![CDATA[
      Add change notes here.<br>
      <em>most HTML tags may be used</em>
    ]]>
  </change-notes>

  <!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
  <idea-version since-build="141.0"/>

  <!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
       on how to target different products -->
  <depends>com.intellij.modules.lang</depends>

  <extensions defaultExtensionNs="com.intellij">
    <!-- Add your extensions here -->
  </extensions>

  <actions>
    <!-- Add your actions here -->
    <action id="testButton"
            class="testButton">
      <add-to-group group-id="ToolbarRunGroup" anchor="last"/>
    </action>
  </actions>

</idea-plugin>

and created sample class for button

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;

/**
 * Created by akrupa on 2016-02-04.
 */
public class testButton extends AnAction {
    @Override
    public void actionPerformed(AnActionEvent anActionEvent) {
        System.out.println("Debug message");
    }
}

Everything works fine, button appears, logs are displaying.

Question:

I uninstalled my test plugin from settings->plugins menu in PyCharm and now plugin doesn't show in PyCharm when I hit Run in IDEA. How I can undo this uninstallation or there's another way to debug custom plugins?

Community
  • 1
  • 1
Adrian Krupa
  • 1,877
  • 1
  • 15
  • 24
  • do you think of debugging as in debugging the program or of debugging as in running pycharm with your plugin? – Niklas Feb 04 '16 at 15:04
  • debugging as in running in pycharm – Adrian Krupa Feb 04 '16 at 15:05
  • Do you have a run configuration? (usually somewhere in the top right corner of IDEA). It should say `Plugin` with a plug next to it – Niklas Feb 04 '16 at 15:06
  • Yes, it's showed on first image. Everything worked fine until I manually uninstalled debugged plugin – Adrian Krupa Feb 04 '16 at 15:07
  • I have no idea why you would want to do that and therfore no solution but as your plugin is still only in a very basic state you could just delete the project and recreate it – Niklas Feb 04 '16 at 15:09
  • Also another thing to mention: the id of your acion in your `plugin.xml` should be the fully specified ID as IDEA manages its dis for UI components centrally. So use an ID which is deifntiley unique or you might run into collisions – Niklas Feb 04 '16 at 15:10
  • I know, it's not the actual plugin. That's just "Minimal, Complete, and Verifiable example" – Adrian Krupa Feb 04 '16 at 15:13
  • You could try to run the deployment of the plugin in IDEA (Build -> Prepare plugin module... ). Then run the project and manually reinstall it. Or just in general: don't uninstall your plugin when you're running it from your IDE – Niklas Feb 04 '16 at 15:16
  • I've tried that, but preparing plugin and reinstalling it every time I've done some changes is not quite productive. – Adrian Krupa Feb 04 '16 at 15:17
  • i guess it usually takes some special kind of deployment and installs it when you hit run. So you destroyed thta by uninstalling it (seriously: why would you do that). Only solution I can think of: delete and recreate project. You just need the generated files from IDEA, the rest can be copied from your old project – Niklas Feb 04 '16 at 15:20

0 Answers0