Let's say I have a scala code that opens in an intellij idea :
object Test extends App { // <- I click here def init[T](xs: List[T]) : List[T] = xs match { case List() => throw new Error("empty list") case List(x) => List() // empty list case head :: tail => head :: init(tail) } val list = List(1,2,4) println ( init(list) ) }
Then, what I do when I want to run this code, I click between the lines where object and def defined so that the IDE knows what I want to run (in this case, the whole object, because I do not select any method). Press CTRL + SHIFT + F10 - to start.
It starts up. I see a “Test” in my configuration layout ... But at that moment I stop the compilation process .. and move on to this configuration to change the configuration.
What I changed: this is the "Before you start" section to launch it using "sbt: compile" . I do this because I want to rely on SBT, but not on the IDE .
Question: Is there a way to run / compile in sbt by default in IntellyJ IDEA?
source share