Including local var info in Idea classes to aid plugin development

Hello,

I am writing a custom lang plugin for Intellij Idea 10. In the typical plugin dev setup, the included Idea classes do not have local variable information. My goal is to include local var information so that I can step into idea classes when debugging my plugin code. What is the best way to do this?

thanks
Siddharth

0
2 comments

Hello Siddharth,

If you build the CE distribution from source, it will include debug info
in the jars by default.

I am writing a custom lang plugin for Intellij Idea 10. In the typical
plugin dev setup, the included Idea classes do not have local variable
information. My goal is to include local var information so that I can
step into idea classes when debugging my plugin code. What is the best
way to do this?


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Avatar
Permanently deleted user

I'm assuming here that you're running the Ultimate Edition of IDEA (also known as "IU" edition) and your problem is not that you can't see the source, but that when you're debugging your plugin all the classnames and variables are obfuscated?
This is because your run configuration is running your plugin in an instance of the "IU" edition - the binaries of which are intentionally obfuscated.

Assuming this is the problem - what you want to do is run your plugin in an instance of the Community Edition so you can see the variable, parameter and classnames.

  • Download the Community Edition (IC) and install it (don't need to run it)
  • Start your Ultimate Edition (IU) plugin development IDE
  • Go to project settings\SDKs, click the add button and create a new "IntelliJ IDEA Plugin SDK"
    • select the directory where you installed the IC edition
    • It will create a new SDK with a name something like "IDEA IC-107.105" (as opposed to the one you're using now which is probably named "IDEA jdk" and points at your IU install).
  • Go to your "Project" settings and change "Project SDK" to use this new SDK (this step probably isn't necessary since your module settings are already created, but do it anyway)
  • Go to your "Modules" settings, then the "dependencies" tab and make sure "Module SDK" is set to the new SDK


Next time you run your plugin using the run configuration thingamajig, it will run it in the IC edition of IDEA which has all the debug info you're after.

If you want to see the source for the classes and variables that you can now see in your debugger, you need to hook the source up for the "IDEA SDK" that you created above (under the "sourcepath" tab of the SDK).  You'll need to get the sourcecode from Git, but you don't need to actually build the CE from sources.

One thing to note though, is that if you just pull the latest source from Git, you'll actually have the sources for the *next* version of IDEA (which is probably not what you want and may not even be stable).
If you just want the source for the version of the IDE that you're developing your plugin for, make sure you checkout the correct source ("idea/107.105" for v10.5 of IDEA).

0

Please sign in to leave a comment.