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?
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.
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.
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.
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.
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"
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