~run does not work as expected for sbt project in IJ

IntelliJ Ultimate 2020.3 with most recent Scala plugin and scbt.
I am trying the very first Scala sbt project in IntelliJ - following steps in:
https://docs.scala-lang.org/getting-started/intellij-track/building-a-scala-project-with-intellij-and-sbt.html 

If I run sbt on command line I get:  

[success] Total time: 1 s, completed Mar 10, 2021 6:37:46 AM
[info] 1. Monitoring source files for sbtexampleproject/run...
[info] Press <enter> to interrupt or '?' for more options.
[info] Build triggered by D:\work\Scala\projects\SbtExampleProject\src\main\scala\example\Main.scala. Running 'run'.
[info] compiling 1 Scala source to D:\work\Scala\projects\SbtExampleProject\target\scala-2.13\classes ...
[info] running example.Main

So basically sbt rebuilds and reruns everytime source is saved. 

But in IJ (sbt shell) the process is interrupted:  

[success] Total time: 1 s, completed Mar 10, 2021 7:02:28 AM
[info] 1. Monitoring source files for sbtexampleproject/run...
[info] Press <enter> to interrupt or '?' for more options.
[info] Received input event: CancelWatch.
[IJ]

So I have to retrigger the build every time I finish editing.

Is there a way to make sbt in IJ behave same way as CL? 

2
3 comments

I'm struggling with this exact issue. I want the IJ sbt task to watch for file changes.

0

same thing I want to ask

0

So any solution for this? I want auto build too.

0

Please sign in to leave a comment.