简体   繁体   English

IntelliJ IDEA中的调试Scala编译器插件

[英]Debug Scala compiler plugin in IntelliJ IDEA

I would like to write my compiler plugin for scalac , but I get a problem in early state in development because I cannot run and debug my code from IntelliJ IDEA. 我想为scalac编写我的编译器插件,但由于无法从IntelliJ IDEA运行和调试代码,因此在开发的早期阶段遇到了问题。

I use these tutorials for implementing a dummy plugin: 我使用这些教程来实现虚拟插件:

My goal is to run my plugin somehow in debug mode in IDEA to encounter breakpoints. 我的目标是以某种方式在IDEA中以调试模式运行插件以遇到断点。

Update: 更新:

The answer below helped me a lot but actually, I added arguments for debugging for JAVA_OPTS environment variable with suspending until remote debugger connection option. 下面的答案对我有很大帮助,但实际上,我添加了用于调试JAVA_OPTS环境变量的参数,并挂起直到远程调试器连接选项。 Then I started scalac and run remote debugger described below. 然后,我启动了scalac并运行如下所述的远程调试器。

To debug a java process in IntelliJ IDEA you need to create a Remote run configuration first. 要在IntelliJ IDEA中调试Java进程,您需要首先创建一个Remote运行配置。

远程运行配置

Specify an available port number. 指定可用的端口号。 If you select Listen debugger mode your java process will be suspended on the start until you connect to it with the debugger. 如果选择“ Listen调试器”模式,则Java进程将在启动时被挂起,直到使用调试器连接到它为止。

远程运行配置2

Run your process with additional command line arguments and start this remote configuration in the debug mode. 使用其他命令行参数运行您的进程,并在调试模式下启动此远程配置。

If you run scala compiler from IDEA, these command line arguments should be added to Scala Compile Server: 如果从IDEA运行scala编译器,则应将以下命令行参数添加到Scala Compile Server:

Scala编译服务器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM