简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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