Search code examples
intellij-ideakotlinintellij-plugin

How to add Kotlin PSI source files to IDEA Plugin project configuration


I am trying to add support for kotlin for one of the IDEA plugins.

So far, I found this page and understood that I need to work with kotlin PSI files, such as KtClass and others.

When I was setting up my project I added idea source files to sdk(by cloning this repo), to make it easier to debug + see documentation.

However it seems that these idea source files doesn't include kotlin source files, such as mentioned KtClass and others, which I use in my project. Currently I see only decompiled version of these files.

Is there any way to add them like with other IDEA source files?


Solution

  • Those source files belongs to the Kotlin plugin, which is not strictly a part of IntelliJ IDEA distribution. You need to add the Kotlin plugin source to the project as well as the IDEA source.

    There're two modules needed: