I've seen a few articles describing how to debug Scala applications, but nevertheless I want to ask it again due to the reason that all those articles are outdated and all things change very quickly in Scala world.
I use IntelliJ Idea 12 + sbt (not a plugin, a plugin doesn't work for some reason).
So how do I do that nowadays?
To enable that, we need to go into our project preferences and specify that behavior. Note checkboxes next to the label, “Use sbt shell”. Enable “for imports” and “for builds” and then click “OK”. This will cause IntelliJ to run an instance of SBT to both build and to manage project dependencies.
Run the program in debug modeClick the Run icon in the gutter, then select Modify Run Configuration. Enter arguments in the Program arguments field. Click the Run button near the main method. From the menu, select Debug.
IMO, you are best off keeping SBT and Intellij separate, as they are two different concerns. One is for building, and the other is for developing.
Here are the steps that I typically go through to get a solid Scala/Intellij development environment up and running for a new Scala project.
sbt gen-idea
On the sbt side, I typically keep a terminal open, with sbt running so that I can rapidly test things outside the context of Intellij.
HTH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With