1

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.

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.

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. Then I started scalac and run remote debugger described below.

1 Answer 1

4

To debug a java process in IntelliJ IDEA you need to create a Remote run configuration first.

Remote run configuration

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.

Remote run configuration 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:

Scala Compile Server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.