简体   繁体   中英

Debugging a Scala project (IntelliJ Idea 12 and sbt)

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 ?

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.

  • Step 1: Install Scala Intellij Plugin
  • Step 2: Create a simple sbt project - details here
  • Step 3: Add the fantastic sbt-idea plugin to your sbt config
  • Step 4: sbt gen-idea
  • Step 5: Open project in Intellij 12
  • Enjoy debugging, syntax highlighting, code assist and all of the other nice IJ features.

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

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