Scala.meta macro support in EAP

Hi,

For my master thesis, I am currently experimenting with scala.meta. According to this workshop, it should be possible to enable scala.meta support in Intellij IDEA by using the EAP version, which seems really neat. So I installed this version with the EAP version of the Scala plugin. Unfortunately, my code still turns red in the IDE. I am using version 2016.3.2.10 of the plugin.

package scalaplayground.macros

import scala.annotation.compileTimeOnly
import scala.meta._

@compileTimeOnly("scalaplayground.macros not expanded")
class Main extends scala.annotation.StaticAnnotation {
  inline def apply(defn: Any): Any = meta {
    val q"object $name { ..$stats }" = defn
    val main = q"def main(args: Array[String]): Unit = { ..$stats }"
    q"object $name { $main }"
  }
}
2 comments
Comment actions Permalink
Official comment

EAP with scala.meta support will be out next week. But in case you're eager to test the upcoming features, you can switch to "Nightly" update channel in Scala plugin settings.

Comment actions Permalink

Thanks for your reply. Good to know that it's coming to the EAP version soon!

0

Please sign in to leave a comment.