You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FWIW, in Scalafmt we have a scalafmt-dynamic_2.{11,12,13} library that is written in Scala and provides an implementation of scalafix-interfaces that dynamically loads the correct version of scalafmt-cli. Both Metals and IntelliJ use scalafmt-dynamic to interact with scalafix-interfaces. The benefit of this approach is that scalafmt-interfaces only contains Java interfaces and all the logic is implemented in Scala.
I have a local branch almost ready with a pure Java implementation inside scalafix-interfaces (using https://github.com/coursier/interface), which I think is fine. We can discuss once I open the PR!
Maybe another benefit of replicating that approach is to try to align classloaders so that scalameta can at some point be shared across scalafmt & scalafix somehow?
As discussed in #1150 (comment),
scalafix-interfaces
should provide (Java) helpers for:scalafix-cli
The current helper is pretty low-level:
scalafix/scalafix-interfaces/src/main/java/scalafix/interfaces/Scalafix.java
Lines 71 to 83 in d4f3b8e
This will remove the need for custom code in
sbt-scalafix
,mill-scalafix
, and all other clients.The text was updated successfully, but these errors were encountered: