-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScalaBuildTarget: split jars
into scalacJars
and scaladocExtraJars
#229
Comments
jars
into scalacJars
and scaladocJars
jars
into scalacJars
and scaladocExtraJars
If we agree on this I could prepare a PR |
This is a good observation. How about adding |
@olafurpg Can private field removal break the clients? API will be unchanged: |
The clients don't necessarily use the Java API. I believe sbt for intance implements its own. We can deprecate the field however. |
Ahh, I opened this repo for the first time and only saw
Won't their implementation be broken (out of sync with the spec) if we add a new field anyway? |
bsp4j is generated from the xtend sources, bsp4s is updated manually, as is the spec.
Yes, so we should only add things in a backward-compatible manner to ensure interoperability between different versions of clients and servers. |
Ok. Let's agree on what exactly to keep: |
Option 1 (to keep all |
Does IntelliJ use the Scaladoc jars? Metals doesn't use it. I'm curious if we need |
For Scala 2 it does, but the classpath just equals the compiler classpath.
That's also an option. BTW is there a list of known BSP clients or is it just IntelliJ and Metals? |
So that implies that BSP implementations need to fix their implementation not to include redundant classpath jars to |
It's pretty much just those two right now, yes.
Yes |
In Scala 2
jars
contains compiler jars which can also be used to generate scaladoc (because it's built-in into scala-compiler.jar).In Scala 3 the set of jars required for ScalaDoc includes 42 jars.
Only 13 of those jars are required to create a scala compiler instance.
Currently
ScalaBuildTarget.jars
returns all 42 jars for Scala 3.This leads to compiler classpath pollution.
see related:
IntellIJ: sbt projects: Scala3 SDK compiler classpath contains redundant jar files
Add ScalaInstance.loaderCompilerOnly
I already have a local fix for sbt projects (https://youtrack.jetbrains.com/issue/SCL-19086) via patching sbt-structure-extractor plugin
We could replace
ScalaBuildTarget.jars
field withscalacJars
(13 jars) andscaladocExtraJars
(29 jars).add methods getScalacJars, getScaladocExtraJars, getScaladocJars = getScaladocJars ++ getScaladocExtraJars
deprecate methods
getJars
,setJars
getJars would by default return getScaladocJars
setJars would set scalacJars, but probably would set scaladocExtraJars to an empty list
The text was updated successfully, but these errors were encountered: