1

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?

ice1000
  • 6,406
  • 4
  • 39
  • 85
Ruslan Akhundov
  • 2,178
  • 4
  • 20
  • 38

1 Answers1

1

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:

ice1000
  • 6,406
  • 4
  • 39
  • 85
  • thank for your answer. I added sources you mention, and indeed I can see there now `KtClass` source file in idea, but somehow IDEA doesn't map `KtClass`which I am using in my code to this source files, so using search in project I can see poth `.class`and `.kt` files, but when I am clicking on class I am using/or debugging I still just see decompiled version. – Ruslan Akhundov May 05 '18 at 10:26
  • Have you tried adding the source as a library of all your modules? – ice1000 May 05 '18 at 12:03
  • not sure what do you mean? Currently in setting I have specified Intllij SDK, where I added `kotlin-plugin` to `classpath` and sources from your links to `sourcepaths` – Ruslan Akhundov May 08 '18 at 19:00
  • If you're using gradle, this is incorrect. You need to create a `library` and add all sources into it and add the `library` as a dependency of the `module`s. All operations can be done in the Project Structure dialog – ice1000 May 09 '18 at 00:32