Reputation: 11607
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
.
sbt clean
sbt reload
sbt update
sbt compile
sbt assembly
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)
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:
rm -rf
) build-related directories like .idea
, target
, ~/.ivy2/caches
Invalidate Caches / Restart...
IntelliJ IDEA
and Scala
plugin to latest versionsIntelliJ
, reboot the PC (!)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
Reputation: 231
This solution worked for me: Why does intellij IDEA highlight build.sbt?
Go to the menu: File > Invalidate Caches/Restart
Upvotes: 2
Reputation: 5850
Such things happen when project SDK is not set. Also make sure that you have Add Framework Support -> Scala enabled.
Upvotes: 0