IntelliJ IDEA 2022.2.3 Scala Worksheet not working - scala

New to scala and I am doing this course https://www.coursera.org/learn/effective-scala
I am following the installation instructions, have installed Scala, latest JDK and IntelliJ on my PC. I installed the Scala plugin as well.
I have downloaded the empty project from the course and imported it into Intellij and have opened the worksheet which has just some basic lines inside. When i try to evaluate the project, the right side shows nothing, but the green tick it had before turns to an exclamation mark, so something must be wrong...
I can't click the exclamation mark or hover over it, no errors to be seen anywhere apart from the visual, see the screenshot below:
As you can see top right there is a red circle with an exclamation mark in it.
Note that when I run the Scala REPL, that works fine, as you can see below with the latest version

I ran into a similar issue while trying something out in Intellij IDEA 2022.2.4 (Ultimate Edition) on macOS Ventura.
Do the following to fix it:
Click the little spanner icon (Show worksheet settings).
On the first tab in the dialogue box (Settings for <sheet name>),
=> Check Interactive Mode
=> Change Run Type to Plain
=> Click OK.
[Optional] If you don't see the evaluation happening after those settings, click the Play button (Evaluate worksheet) on the worksheet. This should only be for the first time (automatic evaluation in subsequent changes to the worksheet content.
See the image below for the settings described above:

Related

Cannot run a Scala program in IntelliJ

So I made a project in Scala -> Activator. I am trying to run it but I cannot even select it, it has a main function. When I press the alt+shift+F10 nothing happens at all.
The icon for the main.scala file also has some red thing in the bottom right corner, which I'm unsure what that means.
Also if I edit the file there is no star at the filename, like if it was unchanged.
Answering rather than deleting this question. I solved the problem by creating a Maven project or by using sbt, it will not run right out of the gate like Java (coming from a Java background).

Show which class/traits/object are incorrect in IntelliJ's Project window

How do I have IntelliJ's Project window show me which class/traits/object are incorrect in terms of compiling - before compiling? This was shown in NetBeans back in the day.
I am talking about this window:
After all, IntelliJ is able to show me the little green tick in the upper right corner:
It doesn't work for Scala as for Java. You can see that file Issue1.java won't compile.
But you can use Make Project feature that will Compile all modified and dependent files in a project by hitting Ctrl+F9.

Eclipse: Edit code parser

I am using a plugin for Eclipse (The Eclipse plugin of SDCC).
This works fine (so far) but the problem is the inline assembly..
it is pretty annoying that the parser marks this code as syntax error
and furthermore that it marks symbols which are defined in a header file.
Therefore I want to extend the plugin a little bit such that the parser(s)
ignore the inline assembly part since the SDCC compiler will complain about it
anyway if it finds an error.
I've seen that there is an error parse since CDT 7.0 but I am not sure if this is
the right place to look at.
Can anyone help?
Place mouse pointer over highlighted code, then press F2 to have focus in popup suggestion window. At left corner of this window exists icon, click on such icon opens problematic item.
By setting/removing checkbox 'Text As', editor with highlighted code will be change view as well.
Usually they are all accessible through Window->Preferences->General->Editors->-Text Editors-> Annotations.
I used it on kepler CDT.

cant see the errors in my project - Exclamation mark

When I'm trying to run my project it said that i have an errors in my project, but i can't see any. I have an Exclamation mark on my project. If I'm trying to run other project, it is run perfectly.
Before that happened, I played a little bit with the project library and tried to copy some jars to the library. I tried to copy the jars manual to.
Thanks!
did you try the "Problems" View? This should show additional information.
The easiest Way to get there:
Ctrl + 3, then type "Problems".
-Hannes
Besides the "Problems" view, there is also the Console that could give you some hints.
For the Console View, there is the problem that it can show different subviews; for example it can show the console for Android or the console for DDMS. In the toolbar at the upper right of the Console view, you will find the control to choose the right console to display. Be sure to choose the "Android Console".
Another possibility is to use the "Fix Project Properties" that you will find by right clicking on the projet => Android Tools -> Fix Project Properties. This will fixes some but not all the potential problems that you might have introduced in your project.
For the rest, check in detail all properties of the project.

IntelliJ IDEA Scala plugin doesn't find errors

I've just tried IntelliJ IDEA 12 with the Scala plugin, but it doesn't find and highlight errors in my code. I can for example write arbitrary code in a method and it looks like everything is fine. Is IDEA not able to do this? Or do I have to configure something special?
IDEA's Scala plug-in is not equivalent to the compiler in type-checking your source code, but it does pretty well. The one thing you'll want to do (unless, perhaps, your hardware is not fairly current and high-performance) is turn on "Type-Aware Highlighting."
If you look in the lower-right-hand corner of the IDEA window (when you're editing a project with Scala enabled) you'll see one of two icons, both of which take the form of a square-bracketed bit of text. That text is either blank on a yellow background or the letter T on a green background. Clicking it toggles between those two states. When the green T is displayed, Type-Aware highlighting is on.
Give that a try.
Simply updating the plugin version could fix the problem. Old or install/initial plugins may not contain relevant support.
Determining Scala plugin version in Settings: