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

浪子不回头ぞ 提交于 2021-02-17 03:44:44

问题


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?


回答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:

  • https://github.com/JetBrains/kotlin/tree/master/idea
  • https://github.com/JetBrains/kotlin/tree/master/compiler/psi/src/org/jetbrains/kotlin


来源:https://stackoverflow.com/questions/50183198/how-to-add-kotlin-psi-source-files-to-idea-plugin-project-configuration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!