Intellij has incorrect scala syntax errors

I have this piece of code:

object Application {
  def main(args: Array[String]) {
    import scala.concurrent.ExecutionContext.Implicits.global

    val ws = new NingWSClient(new AsyncHttpClientConfig.Builder().build())
    ws.url("https://www.google.com").get() onSuccess {
      case resp: WSResponse => {
        println("Hello");
      }
      case _ => {
        println("Error");
      }
    }
  }
}

Each dependency is well defined internally build.sbtas follows:

name := "example"

version := "1.0"

scalaVersion := "2.11.4"

libraryDependencies ++= Seq(
  "com.typesafe.play" %% "play-ws" % "2.4.0-M2",
  "com.typesafe.play" %% "play-json" % "2.4.0-M2"
)

But Intellij looks like this when viewing my project:

Intellij

Can someone tell me what I am doing wrong because I am clueless and it is really annoying because my import is permanently deleted by Intellij.

+4
source share
1 answer

It looks like an IntelliJ (or Scala) error. Sometimes the Scala namespace does not seem to handle well - I also saw it with my projects, as I updated it to version 14. Sometimes it helps to use File / Invalid Cache / Reload .

/ Scala SDK . scalap.jar SCL-8025 Standard Scala, sbt 2.11.4, (Scala %userprofile%\.IntelliJIdea14\config\plugins\Scala\lib ).

SCL-7900 Scala / , , Idea JRE Java 8 - 1.8 JDK IDEA_JDK_64 jdk7-64bit .

+6

All Articles