Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Scala interpreter (REPL) - proper use and debugging

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?

like image 534
PrimosK Avatar asked Apr 16 '12 09:04

PrimosK


People also ask

What is the use of scala REPL?

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.

How do I open a scala file in eclipse?

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.


1 Answers

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.

like image 94
S. Kucherenko Avatar answered Oct 30 '22 21:10

S. Kucherenko