1

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?

Shafique Jamal
  • 1,550
  • 3
  • 21
  • 45
  • The red import is normal. But the `->` should not be red. How do you created the IDEA project, with `mill mill.scalalib.GenIdea/idea`? And what version of mill are you using? – Tobias Roeser Nov 29 '19 at 07:15
  • @TobiasRoeser thanks for this quick response. I am using mill version `0.5.2`. Yes, I used the command `mill mill.scalalib.GenIdea/idea` to create the IDEA project. – Shafique Jamal Nov 29 '19 at 13:10

1 Answers1

1

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.

Tobias Roeser
  • 431
  • 2
  • 8
  • This worked. Dumb oversight on my part. I chose the Java 11 SDK, and prefixed `def forkEnv` with `override`, and that took care of those syntax highlighting errors. Thanks! – Shafique Jamal Nov 29 '19 at 13:12