While debuging macro annotation IntelliJ throws this error:
test\UseMacro.scala:7: error: macro annotation could not be expanded (the most common reason for that is that you need to enable the macro paradise plugin; another possibility is that you try to use macro annotation in the same compilation run that defines it)
@identity class Test
I have the main project that uses macro subproject (macroSub). Macro project defines simple @identity macro and the main project uses this one with UseMacro.scala
build.sbt:
lazy val commonSettings = Seq(
version := "1.0",
scalaVersion := "2.11.7"
)
lazy val root = (project in file(".")).
dependsOn(macroSub).
enablePlugins(PlayScala).
settings(commonSettings: _*).
settings(
name := "root",
resolvers ++= Seq(
"Akka Snapshot Repository" at "http://repo.akka.io/snapshots/",
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
),
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT",
"com.typesafe.akka" %% "akka-agent" % "2.4-SNAPSHOT"
)
)
lazy val scalaReflect = Def.setting { "org.scala-lang" % "scala-reflect" % scalaVersion.value }
lazy val macroSub = (project in file("macro")).
settings(commonSettings: _*).
settings(
resolvers ++= Seq(
Resolver.sonatypeRepo("releases")
),
libraryDependencies += scalaReflect.value,
libraryDependencies += compilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full),
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")
)
I can successfuly debug normal macros but when i create a macro annotation i have this kind of error. What should i to do with my intellij configuration and build.sbt to solve that problem and debug macro annotations?