Describe the bug
The VS code task "build import" is very sensitive to semanticdb-versions. If the extension sbt-scalafix is enabled on a project, and sbt-scalafix's required version of semanticdb doesn't exactly match whatever version of semanticdb metals add to the bloop configs, the import will fail.
To Reproduce
Steps to reproduce the behavior:
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.5")addCompilerPlugin(scalafixSemanticdb)Expected behavior
Importing a project where scalafix is used should work.
Since metals adds its desired version of semanticdb to all projects it imports while generating bloop configs, this may well clash with the version required by scalafixSemanticdb. I'm not sure how to work around this; perhaps metals could be more sensitive in detecting if there are other versions of semanticdb already installed and use those if they are compatible.
Error log
[warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:
[warn] * org.scalameta:semanticdb-scalac_2.12.8:(4.1.9, 4.2.0)
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
…
[error] Missing required plugin: semanticdb
[error] bad option: -P:semanticdb:synthetics:on
[error] bad option: -P:semanticdb:failures:warning
[error] bad option: -P:semanticdb:sourceroot:/Users/martin/dev/future-memories/sortapp-es
[error] four errors found
Installation:
Additional context
Search terms
semanticdb metals build import
Thanks for reporting! We are actually working on simplifying the way we add semanticdb plugin and that should fix the issue. Will let you know when we get it working.
Most helpful comment
Thanks for reporting! We are actually working on simplifying the way we add semanticdb plugin and that should fix the issue. Will let you know when we get it working.