I can not use my classes from Scala worksheet in IntelliJ CE with Scala plugin.
I do the following:
Create Scala SBT project.
In src/main/scala create package test1
.
In this package create class
package test1 class TestClass { }
ws1
, inside it put a couple of expressions. It works. new ScalaTest
to object ws1
, IntelliJ adds import test1.ScalaTest
, but evaluation of worksheet does not work. If I add package test1
to my worksheet, it does not work at all, with warning "Package name doesn't correspond to directories structure, this may cause problem with resolve to classes from the file"
Is there any ideas how to use my classes from worksheet?
A worksheet is a Scala file that is evaluated on save, and the result of each expression is shown in a column to the right of your program. Worksheets are like a REPL session on steroids, and enjoy 1st class editor support: completion, hyperlinking, interactive errors-as-you-type, etc.
To install Scala plugin, press Ctrl+Alt+S , open the Plugins page, browse repositories to locate the Scala plugin, click Install and restart IntelliJ IDEA. Now you can successfully check out from VCS, create, or import Scala projects.
You can use eclipse compatibility mode:
Settings → Languages & Frameworks → Scala → Worksheet → use "eclipse compatibility" mode
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