Open ckipp01 opened 1 year ago
I actually don't get why this is happening since this looks correct when you look at the generatedSources
:
❯ mill showNamed scalatags.jvm\[3.1.3\].test.generatedSources
[1/1] showNamed
{
"scalatags.jvm[3.1.3].test.generatedSources": [
"ref:7d898225:/Users/ckipp/Documents/scala-workspace/com-lihaoyi/scalatags/out/scalatags/jvm/3.1.3/test/generatedBuildInfo.dest"
]
}
Plus this looks right as well.
I just checked, both, the source code and the log of the BSP protocol suggests, we properly mark JavaModule.generatedSources
with SourceItem.generated = true
.
The generatedBuildInfo
target comes from the BuildInfo
contrib plugin, so this is probably specific to that plugin. Although, a first look shows, it is also extending JavaModule.generatedSources
, so it should work as expected.
Ah shoot, I was still on Bloop instead of mill-bsp
. Ugh, sorry. So this is actually an issue then probably with the Bloop export.
Actually looking further I don't even see how to do this with the Bloop export. I wonder if this just isn't possible? I'll check. Don't spend time on this @lefou I'll either fix it or close it.
Alright... digging even further. I think the only way we can do this with Bloop would be to utilize sourceGenerators
. However looking at https://github.com/scalacenter/bloop/pull/1774 it's not super clear to me how this is meant to work with a tool like Mill. Would the command just be a mill command to regenerate? That might be hard to configure correctly.
Yeah, when I first looked into the sourceGenerators
thing, I also thought, that it will not match easily with build tools, it's more suited when you use bloop as your primary tool.
When using Mill as a build server the response to
buildTarget/sources
doesn't correctly mark generated sources as such. For example when using build info you'll notice thatgenerated
isfalse
. You can see this for example in Scalatags.In this situation the
generatedBuildInfo.dest
should be marked astrue
for generated.Refs: https://github.com/scalameta/metals/issues/4787