Skip to content

Commit

Permalink
bugfix: Use platform Java from BSP instead of metals one
Browse files Browse the repository at this point in the history
I am hesistant to add a test case, since that would require downloading separate JDK for the sake of one test 🤔

Fixes #5780
  • Loading branch information
tgodzik committed Oct 23, 2023
1 parent 3bc135f commit 5d16c6b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,16 @@ class DebugProvider(
if params.getDataKind == b.DebugSessionParamsDataKind.SCALA_MAIN_CLASS =>
json.as[b.ScalaMainClass] match {
case Success(main) if params.getTargets().size > 0 =>
val javaBinary = buildTargets
.scalaTarget(params.getTargets().get(0))
.flatMap {
_.jvmHome.map(path => path.toAbsolutePath.resolve("bin/java"))
}
.filter(_.exists)
.orElse(userConfig().usedJavaBinary)
val updatedData = buildTargetClasses.jvmRunEnvironment
.get(params.getTargets().get(0))
.zip(userConfig().usedJavaBinary) match {
.zip(javaBinary) match {
case None =>
main.toJson
case Some((env, javaHome)) =>
Expand Down

0 comments on commit 5d16c6b

Please sign in to comment.