I am unable to get a scala worksheet to find any of my project classes when using Intellij. I have added the new scala worksheet to the src
directory of my project as instructed here. However whenever I try to run the worksheet I get the following error
Error:(5, 27) not found: type Order
trait LimitOrder extends Order {
^
The Order
trait is defined in a file included in src/main/scala
. I even tried putting the scala worksheet in the src/main/scala
and it still fails to find the Order
trait.
It appears that the problem goes away if either:
- I open an external
sbt-console
in my project directory. Opening thesbt-console
automatically compiles the project sources. Then return to Intellij and re-run the worksheet. - I manually compile the source inside Intellij prior to trying to run the worksheet.
I was under the impression that the worksheet was being compiled on the fly every time I re-run it and thus manually compiling it should be un-necessary. Is this incorrect?