scalaintellij-ideamill

How do I get IntellijIdea to recognize the syntax in my build.sc file?


Here is my build.sc file:

import mill._
import $ivy.`com.lihaoyi::mill-contrib-playlib:$MILL_VERSION`,  mill.playlib._
object core extends PlayModule {
    //config
    override def scalaVersion= T{"2.12.8"}
    override def playVersion= T{"2.7.3"}
    override def twirlVersion= T{"1.5.0"}

    object test extends PlayTests

    def forkEnv = Map("APPLICATION_SECRET" -> System.getenv("APPLICATION_SECRET"))
}

And here is the syntax highlighting in IntellijIdea: enter image description here

As the screenshot shows, IntellijIdea does not recognize the -> and the $ivy import. How do I get it to do so?


Solution

  • As you can see, if you look at the top of your editor window, your IntelliJ IDEA warns you about an undefined JDK. Just click on it and tell IDEA which JDK it should use. After that, the System.getenv call will be resolved, as it comes from the JDK itself and the red marker should vanish.

    The red import $ivy is currently normal, though.