-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correctly resolve project's java in doctor and problem resolver
- Loading branch information
1 parent
78ded80
commit 5b1e040
Showing
10 changed files
with
169 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
metals/src/main/scala/scala/meta/internal/metals/JdkInfo.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package scala.meta.internal.metals | ||
|
||
import scala.concurrent.ExecutionContext | ||
|
||
object JavaInfo { | ||
def getInfo( | ||
userJavaHome: Option[String] | ||
)(implicit ec: ExecutionContext): Option[JavaInfo] = | ||
for { | ||
home <- JdkSources.defaultJavaHome(userJavaHome).headOption | ||
version <- JdkVersion.maybeJdkVersionFromJavaHome(Some(home)) | ||
} yield JavaInfo(home.toString, version) | ||
} | ||
|
||
case class JavaInfo(home: String, version: JdkVersion) { | ||
def print: String = s"${version.full} located at $home" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.