Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDE support for Scala scripting

Tags:

scala

I plan to try some exploratory programming with Scala, e.g. loading some scala source files and call the functions defined in these source files interactively, maybe doing some plotting in the between.

I want to keep a scripting source file, and occasionally send some lines in it to the scala console using a short-cut such as Ctrl+Enter.

Which IDE supports scripting well?

like image 475
Yin Zhu Avatar asked Oct 30 '11 07:10

Yin Zhu


People also ask

Which IDE should I use for Scala?

IntelliJ works well. However, it does choke on some of the functional libraries like cats (false highlighting). …it works in scalac, and in Eclipse/Scala-IDE.

Can I use Vscode for Scala?

Installing Scala in VS CodeYou can install it for Windows, Mac, or Linux. Step 2: Install Metals Scala Language Server on VS Code. Now open Visual Studio Code and click the Extension button in the left side panel, or press Ctrl + Shift + X.

Can we run Scala in Eclipse?

Testing Scala Installation in Eclipse IDE: Using the Eclipse IDE, we will create a simple Hello World program in Scala. Open the Eclipse, click on the menu and click on the “New” ->Scala project.


2 Answers

The Scala plugin for Eclipse offers two different interpreters. One is the standard REPL, simply integrated within the IDE, the other one is the Run Selection Interpreter which may be very handy for the kind of experimentation you'd like to do, give it a try.

like image 192
Mirco Dotta Avatar answered Oct 01 '22 17:10

Mirco Dotta


The Scala plugin for eclipse is the best out there .

http://www.scala-ide.org/

With the Run Selection Interpreter you can achieve what you want :

An expression can be executed in the interpreter by selecting text in any Scala editor and either selecting the toolbar button (see screenshot) or by using the Ctrl+Shift+X key combination (Cmd+Shift+X on the Mac). The key combination can be changed by going to Keys -> Preferences and changing the binding for the command "Send Selection to Scala Interpreter"

enter image description here

like image 29
aleroot Avatar answered Oct 01 '22 15:10

aleroot