I use zio-macros in a Scala 2.13 / Mill Project.
Here the example:
@accessible
@mockable
trait AccountObserver {
val accountObserver: AccountObserver.Service[Any]
}
object AccountObserver {
trait Service[R] {
def processEvent(event: String): ZIO[R, Nothing, Unit]
}
// autogenerated `object Service { ... }`
// autogenerated `object > extends Service[AccountObserver] { ... }`
// autogenerated `implicit val mockable: Mockable[AccountObserver] = ...`
}
I can run the test and it finds the autogenerated code.
The problem is that in Intellij references to the autogenerated code do not compile.
Do I have to configure something or what is missing?
The following project compiles
build.sc
root/src/App.scala
Command
mill root.compile
compiles the projectCreate IntelliJ files
and then open the project in IntelliJ (do not import it).
Now Ctrl+Shift+F9 compiles the project (similarly to above).
You can use for example reference to object
AccountObserver.Service
(this compiles). Surely IntelliJ highlightsService
in red but this doesn't matter.