I am using IDEA 2017.2.5 to develop in Scala with the SBT plugin. I've been unable to get Scala's code inspection to work correctly. I get lots of seemingly arbitrary errors on valid Scala code, such as "Cannot resolve symbol" or "Type mismatch". Also, lots of imports which I'm definitely using are marked as unused and grayed out.
For example, the following code resolves to " world"
but produces a "Cannot resolve symbol toLowerCase" error:
val s = "Hello, World".split(",").last.toLowerCase
I have tried File -> Invalidate Caches / Restart, reinstalling the SBT plugin, using different Scala versions, with no luck. Turning off type-aware highlighting makes some of the errors go away, but not all of them.
The following SO posts seem similar:
- at scala project, compiler error - Cannot resolve symbol List?
- Scala (Breeze) + Intellij: "Cannot resolve symbol *"
How can I resolve this?