y2k-shubham
y2k-shubham

Reputation: 11607

Scala: IntelliJ highlights correct code in red

One fine day IntelliJ started highlighting my working Scala code in red. While following commands run without a hitch, IntelliJ thinks that code is full of errors an missing a lot of dependencies.

It reports a lot of Cannot resolve symbols in imports, classes and method-calls on objects like the following. Moreover, it thinks a lot of imports are unused (for the symbols that it can't find) enter image description here

Interestingly, all this is happening in only one of my projects (that contains two submodules inside parent module), while other Scala projects (including those containing submodules) are working fine.

Things that I've tried without luck:


I'm using:

My project configurations are:


Once again, I'd like to remind that my Scala code is completely functional and that I'm able to run the JAR generated by sbt assembly elsewhere without an issue.

Upvotes: 11

Views: 3747

Answers (2)

vejeta
vejeta

Reputation: 231

This solution worked for me: Why does intellij IDEA highlight build.sbt?

Go to the menu: File > Invalidate Caches/Restart

Upvotes: 2

streetturtle
streetturtle

Reputation: 5850

Such things happen when project SDK is not set. Also make sure that you have Add Framework Support -> Scala enabled.

Upvotes: 0

Related Questions