如何将Kotlin PSI源文件添加到IDEA插件项目配置中 [英] How to add Kotlin PSI source files to IDEA Plugin project configuration

查看:354
本文介绍了如何将Kotlin PSI源文件添加到IDEA插件项目配置中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为IDEA插件之一增加对kotlin的支持.

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.

在设置项目时,我将想法源文件添加到sdk(通过克隆 repo ),以便更轻松地进行调试+请参阅文档.

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.

但是,这些想法源文件似乎不包括我在项目中使用的kotlin源文件,例如提到的KtClass等.目前,我仅看到这些文件的反编译版本.

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.

是否可以像添加其他IDEA源文件一样添加它们?

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

推荐答案

这些源文件属于Kotlin插件,严格来说,它不是IntelliJ IDEA发行版的一部分.您需要将Kotlin插件源以及IDEA源添加到项目中.

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.

需要两个模块:

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

这篇关于如何将Kotlin PSI源文件添加到IDEA插件项目配置中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆