Solution for debugging DCEVM enabled sbt-scala applications in IntelliJ IDEA

480 Views Asked by At

I use DCEVM to reload classes in my Scala application. Sbt has a nice feature that it can auto-compile classes when their source code changes. So what I do is I open up two sbt instances and I run ~;compile;copy-resources in the first instance to auto-compile, and run in the second instance.

To debug, I can use the remote debugger tool in IntelliJ that works pretty well except for one (but important) thing: whenever sbt reloads a class, IntelliJ no longer stops at break points. I have to restart the remote debugger in order to fix this, which is very inconvenient.

I do not really like the built-in compiler as it is really slow compared to sbt (and also not automatic), however, if I run the program from IntelliJ and execute the Compile file command, the debugging works well.

How could I improve the development process either by having sbt and IntelliJ refresh the break points on class reload or by using another setup? Thank you in advance.

1

There are 1 best solutions below

0
On

The answer is pretty late, but: Have you tried the key combination Ctrl+F9 after you saved your modifications? You should see a baloon pop up saying that one/more classes has/have been modified.

Had the same problem with my Java application. The "refresh" helped.