after upgrade Idea 13->14, scala & sbt code flagged red
I upgraded from Idea 13 to 14 today. Now I can't work with my Scala projects. I get silly red flags for things like this:
val a = Seq[String]
and in build.sbt:
libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.1.4" % "test"
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.0.1"
I saw other posts suggesting "invalidate cache & restart," and I tried that, but the problem remains.
For the Scala plugin, it says I have version 1.0: Scala, SBT, SSP, HOCON and Play 2 Support.
I'm hoping I don't have to roll back to Idea 13. Is Idea 14 + Scala unstable?
Geoff
Please sign in to leave a comment.
This is has been the kind of bad productivity day I dread. Tool brittleness makes Scala look bad.
Something crazy about this Idea 14 upgrade: I can still compile and run Scala programs, but all my source code looks like hell (full of red) as though the IDE has no idea what a Seq or a List is when displaying a Scala file.
Hm, you are not the first one, who has such problem. It's pretty bad as it really means that Scala plugin is unstable now in IntelliJ IDEA 14. Sorry for inconveniences.
However, I can't reproduce it. Can you attach .idea folder? Probably it can help us to understand the problem.
Best regards,
Alexander Podkhalyuzin.
Had the same problem in gradle hybrid scala/java project. Solved with uninstalling old scala plugin from EAP and reimporting a project.
Most probably Invalidate caches helped you. As uninstalling plugin causing invalidate caches.
Best regards,
Alexander Podkhalyuzin.
Invalidate cache & restart does not help me, but I have noticed something else. Let's say I have a code line that looks like this:
val a: Seq[String]
After a restart, Idea14 says at the bottom, "Indexing..." And while it is indexing, the above code line looks OK.
Right after "Indexing..." comes "Refreshing 'foo' SBT project." At that moment the above line switches to:
val a: Seq[String]
I tried deleting the ~/.sbt directory and restarting. It did not help.
I tried deleting the ~/.ivy2 directory and restarting. It did not help.
Have you double-checked that you have the Scala compiler libraries configured correctly in the Project Structure settings?
The project settings and libraries were all fine. However, after a morning of struggle (following yesterday afternoon's struggle), in total frustration I deleted everything in this project that had anything to do with Intellij settings. I got rid of the SBT project that IDEA had created. I got rid of the entire .idea directory. I recreated the project from scratch from the sources that remained. I still got red for ordinary Scala syntax, but then I did yet another Invalidate Cache & Restart, and to my amazement, this time, after restart, the syntax did not turn red after the "Indexing..." step was done.
So, it took at lot of effort and deleting things and reinstallating Scala and SBT and recreating IntelliJ project files from scratch, but finally I am able to resume regular work on this Scala project.
I'm really sorry for such inconveniences. We will try to find the solution for indexes problem in the future releases, it looks really important as it's really painful.
Best regards,
Alexander Podkhalyuzin.
Alexander, thank you. The good news is now I'm up and running and I like the new features in Idea14.
When I was having problems, the syntax looked fine until the "Indexing..." process was done and the SBT processing began, at which some ordinary Scala syntax turned red. Maybe the problem is with the process that was doing the indexing. Or maybe not. Deleting the old project files and recreating the project from scratch and then doing another Invalidate Cache & Restart was what ultimately got me from Blocked to Running.
@Geoffrey's solution didn't work for me. Please consider reporting possible fixes. Here's the link to my question.
Issues popped up again for me going from 2017 build to 2018.... issue is going strong for years now...
Suggestions here don't seem to fix it
I have the same issue in IDEA 2018 Ultimate. Scala plugin installed.