Attaching SDK sources to IntelliJ Platform Plugin correctly to resolve Kotlin files

Assume you have configured a plugin without Gradle as simple Plugin module that you can choose from "Create Project". Now, you have created your IntelliJ SDK by selecting the folder of the running Community Edition. You can now attach sources to it by e.g. cloning the GitHub repo and selecting it or by downloading ideaIC-2017.3.1-sources.jar

When I add these sources to the SDK everything seems fine but I noticed, that I cannot navigate to com.intellij.openapi.components.StoredProperty which is located in ideaIC-2017.3.1-sources.jar!/com/intellij/openapi/components/StoredPropertyBase.kt

The thing that is surprising is that this is the case for (maybe) all Kotlin classes.

I checked how Gradle does it and tried something different which works: Download idea.zip and idea-sources.jar. Create a new IntelliJ SDK from the unpacked idea.zip (if this is really necessary is nothing I have tested). Then I create a new library for my plugin module where I select all jars from the /lib folder inside the unpacked idea.zip. THERE, I attach idea-sources.jar and I add this library to my plugin module and flag it as "Provided". After that, I can navigate to e.g. "BaseState" class and the correct Kotlin source is shown.

Why is that? Isn't there an easier way for non-Gradle setups?

0

Please sign in to leave a comment.