How do I attach code for the plugin/devkit module?
The source code (IDEA 11 CE sourcecode pulled from github and updated to the idea/111.69 tag) for the plugin devkit has a very strange structure.
For example, the PluginRunConfigurationEditor class:
The package is "org.jetbrains.idea.devkit.run" but the actual file sits at "/intellij-community/plugins/devkit/src/run/PluginRunConfigurationEditor.java" - that is, the physical module structure doesn't contain the "org/jetbrains/idea/devkit/run" structure that most people expect would be there (and indeed IDEA itself gets confused by this).
This is also inconsistent with most of the other modules of the IDEA source code (there may be other modules with this non-standard structure, but I couldn't be bothered finding them).
In fact, IDEA itself fails to pick up this dir structure when you add the source code for the your IDEA SDK, it just quietly skips the devkit module and doesn't add it - although it adds most of the other module sources automatically. You can't add the source manually either, if you try to add .../devkit/src IDEA just ignores you without even a warning that it couldn't understand the directory structure (which is nasty, because there's already so many directories in the list that you have to hunt around for ages just to be sure that that it didn't do what it said it did).
In the end, I finally got this working by manually creating a directory structure that mirrors the package structure and copying the source files across and then hooking up the new structure as the source.
How can I hook up the devkit source to my IDEA SDK without hacking the dir structure like this?
Please sign in to leave a comment.
One way would be to make a directory outside the community sources named 'devkit'. Then create src/org/jetbrains/idea inside it, then add to the 'idea' directory a symlink/junction named 'devkit' which points to the jetbrains devkit/src directory.
Then you can attach sources via your new devkit directory
One way would be to make a directory outside the community sources named 'devkit'. Then create src/org/jetbrains/idea inside it, then add to the 'idea' directory a symlink/junction named 'devkit' which points to the jetbrains devkit/src directory.
Then you can attach sources via your new devkit directory
Well, that's a better solution than mine I guess - but the intent of the question was how can I get IDEA to understand the module strucutre without any messing about on disk at all.
Yeah. Idea lets you set a package prefix on your sources directory - which is what Devkit does, They would need to change the source layout or build a sources jar I would think.