-
Notifications
You must be signed in to change notification settings - Fork 335
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
chore: deprecate running Metals on Java 8 #3788
Conversation
.problemMessage(scalaTargets, javaTargets) | ||
.orElse(deprecatedJavaVersion()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build targets' problems first, then jdk deprecation
if (clientConfig.isDoctorVisibilityProvider()) { | ||
isVisible.set(true) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When there is some problem there is also More Information
button, without this snippet, it won't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I broke this in #3768
metals/src/main/scala/scala/meta/internal/metals/doctor/Doctor.scala
Outdated
Show resolved
Hide resolved
e724180
to
035a27f
Compare
metals/src/main/scala/scala/meta/internal/metals/doctor/Doctor.scala
Outdated
Show resolved
Hide resolved
035a27f
to
c3ad737
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a question.
@@ -390,6 +411,17 @@ final class Doctor( | |||
} | |||
} | |||
|
|||
deprecatedJavaVersion().foreach { deprecatedJdk => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it look in the doctor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I wonder about a case where you want to use JDK 8 to build Java files, it currently defaults to whatever you used for import. If you are unable to use it then you might not be able to compile your code. javaHome
should in that case be used for Bloop + running sbt.
We should probably only issue this warnings once we switch to Metals downloading a specific JDK version, so that this would only pop up for users of other editors, who would still be able to run Metals with different versions. (maybe we could make a requirement in coursier? OR build Metals using JDK17 ?)
I think these cases are rare and might be solved by having several jdk installed. |
Yeah, that's why I think we should separate Java used to run Metals (even download our own) from the one used for compilation etc. |
It seems that we stuck here. |
I think we should do a couple of separate step:
There is not much benefit in deprecating it here without those steps I feel. |
Sounds very reasonable. |
What do you mean here by |
Yeah, similar way that ScalaCLI does it. Currently, it's not working too great since we just run with whatever Bloop is started with. |
I wouldn't go this way. Even if we tune options with proper release flags some user might face the issues during the |
We already have options for that, run/debug should be launched using platform settings and not the current Java version, so this should not be an issue.
I think Metals can still start the bsp server with a proper Java from |
@tgodzik ok, sounds good! |
@tgodzik Could you put this (in a bit more verbose form) into an issue? Until it happen, I'll keep this PR open to not forget about conclusions. |
Done! #3923 |
As discussed in #3784