Run my code written in Scala IDE (eclipse) in REPL - eclipse

I have written my Spark code in Scala IDE (eclipse) and it 'runs' well here.(it is a Scala object and I have saved it as a .scala file on my computer)
Now i'm trying to run it in REPL. I'm not sure how I can run it in REPL, by copy-pasting it or by 'loading'.
Run in Scala IDE,
Run in REPL
Any help in this case would be greatly appreciated.
regards,
Behrouz

There are two option you can load a file and paste the content.
To load a file use
:load filename.scala
To paste the content
:paste Command-V on a Mac, Ctrl-V on Windows)
and press CTRL-D for evaluate

Related

How to add new SBT shell tab in IntelliJ IDEA?

I want to add one extra sbt shell in the IJ. How to do it?
I want to run some sbt commands inside a two different SBT Shells.
An easy solution is to run one SBT in the sbt shell and the second in a terminal. You can run a terminal inside of the IDE by using menu View | Tool Windows | Terminal - see Terminal in the IDEA Help. When you open a terminal, it is opened with a project directory as a current directory. You type sbt and you have another sbt running for your project.
This second SBT has some limitations compared to a SBT shell:
you cannot navigate to errors and warnings by clicking on them
the SBT will not reload when you press Reload SBT in the IDE
Still, depending on what you want, it might provide a working solution.

interactive debug console for Intellij and Eclipse like Pycharm has

PyCharm has interactive debugging console:
It allows you to check various things in runtime.
I've searched for similar functionality in Eclipse and in Intellij, and couldn't find.
Does it exists there? Thanks
Eclipse has Debug shell which you can use to write custom code and execute when you are in debug mode.
In IntelliJ, you can right click on any code that is in scope of debugging, evaluate expression and in that dialog you can keep custom code and evaluate.

Load file in REPL is not working in Eclipse-counterclockwise

I am a newbie to Clojure and Counterclockwise plugin for Eclipse. I can load the file into REPL for the first time. After that, If I make any changes to the code and try to load into REPL by commands (ctrl+alt+S) or by right-clicking and choosing the respective option, the files is not loading to the REPL.
For time being, I am restarting the REPL to load the changes. Is there any settings available for this to fix it? FYI, I am using eclipse Mars and Counterclockwise 0.34.0.STABLE001 plugin for eclipse.

Scala IDE Template Editor Broke

I just downloaded the scala ide 4.0 release candidate 1 on my windows machine. I setup a basic play scala project and tried opening the the index.scala.html file with the New Play Editor and the file doesn't open.it looks like this:
So then I tried opening the file in the regular play editor and when i type, the characters are typed in reverse:
Anybody know how to go about fixing this?
This might be a problem with your installation, if you are on Windows and you installed it under Program Files. Try moving it somewhere else (preferably without spaces in the path, though this is a permission issue). See this long thread on the Scala IDE mailing list.

How can I run a Scala project as a Scala application by default in Eclipse IDE?

I am a novice to the Eclipse IDE and the question is how can I run a Scala project as a Scala application by default? When I run the project by hitting the ⌘R key, it always asks how to run it, as a Scala or Java application. Is there a way to skip this and always run it as Scala by default?
I guess it's somehow related to the launch configuration, but when I try to make a new launch configuration for the project, it doesn't give me the option of Scala: only Java applet and Java application are shown as choices.
I appreciate your help in advance!
Window > Preferences > General > Keys
Scroll down and select Run Scala Application
Edit the Binding to ⌘R or whatever you want.
This changes the binding for your whole workspace, so it doesn't distinguish between Java and Scala applications. It would be nice if the runner had a box you could tick to choose the default, but this is a decent workaround.