-
I am trying to reach developer "nirvana" by using Metals to edit and develop my Mills scripts. Currently I have to replicate the project and use IntelliJ for this. In my experiments I found that because the *.sc are treated as Ammonite scripts by Metals, I do not have access to the Mill API. I tried then to added the following imports: import $ivy.`com.lihaoyi:mill-main_2.13:0.11.1`
import $ivy.`com.lihaoyi:mill-scalalib_2.13:0.11.1`
import $ivy.`com.lihaoyi:mill-contrib-bloop_2.13:0.11.1` And placed in the first line of the script: // scala 2.13.3 Now intellisense works well, however the following code will fail to compile: import mill._
import mill.scalalib._
import mill.define.ModuleRef
import coursier.maven.MavenRepository
import mill.contrib.bloop.Bloop
val ScalaVersion = "3.3.0"
trait CommonSettings extends SbtModule with Bloop.Module {
def scalaVersion = T{ ScalaVersion }
def aTask = T {
T.log.debug("This works")
}
}
object docs extends CommonSettings {
} For the could not find implicit value for parameter outerCtx0: mill.define.Ctxscalac Seems like Mill's macros don't work here. My other strategy would be to substitute the ammonite binary with the TIA |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Have you tried using mill via BSP for this? Ideally this would be supported as a separate build target there, but I don't exactly remember if that is currently the case. Alternatively, we could go the sbt Bloop plugin way, where we would generate additional Bloop config for mill build definition when running the import via For the second option I don't have any time to work on that currently unfortunately, so this would need some love from anyone with spare time on their hands. |
Beta Was this translation helpful? Give feedback.
-
I have my answer. I will assume this is not possible at the moment so am closing this thread. |
Beta Was this translation helpful? Give feedback.
Have you tried using mill via BSP for this? Ideally this would be supported as a separate build target there, but I don't exactly remember if that is currently the case. Alternatively, we could go the sbt Bloop plugin way, where we would generate additional Bloop config for mill build definition when running the import via
mill.contrib.bloop.Bloop/install
For the second option I don't have any time to work on that currently unfortunately, so this would need some love from anyone with spare time on their hands.