I would like to know what are best practises of using Eclipse Scala interpreter (Eclipse Scala IDE).
Let's say I have application with breakpoint in it. Is it possible to debug an application in such a way, that I can execute/evaluate expressions inside REPL at the specific breakpoint? If yes how can I achieve it?
Another thing that made me wonder is what's the difference between opening the interpreter as Run configuration
or opening it trough Window -> Show view -> Scala interpreter
.
Do you know any other uses cases of Eclipse Scala interpreter that are interesting to know about, like for example Ctrl+Shift+X
to run selected expression?
The Scala REPL is a tool (scala) for evaluating expressions in Scala. The scala command will execute a source script by wrapping it in a template and then compiling and executing the resulting program.
Import the projects into Eclipse. The Scala IDE project already contains the metadata files needed by Eclipse to setup the project. To import the Scala IDE in your workspace simply click on File > Import.
Maybe it is an obvious advice, but in addition to merely starting REPL in Scala IDE you can run selected expression in it: just select the expression and press Ctrl+Shift+X (default hotkey).
Update
There is a comprehensive reference for Scala interpreter (thanks Mirco Dotta).
It is also worth to mention that in near future Scala interpreter is going to be enhanced significantly: integration with Scala debugger and implementation of a concept known as worksheet are on the way.
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