Skip to content

Commit

Permalink
Merge pull request #1821 from tgodzik/try-download
Browse files Browse the repository at this point in the history
bugfix: Try to download semanticdb even if it might not be supported
  • Loading branch information
tgodzik authored Sep 28, 2022
2 parents 75a0d6e + c5db9c6 commit 0365836
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions frontend/src/main/scala/bloop/engine/BuildLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,9 @@ object BuildLoader {
): Option[AbsolutePath] = {
val (scalaVersion, scalaSemanticdbSettings) = scalaSemanticdbVersionAndSettings
// Recognize 2.12.8-abdcddd as supported if 2.12.8 exists in supported versions
val isUnsupportedVersion =
!scalaSemanticdbSettings.supportedScalaVersions.exists(scalaVersion.startsWith(_))
if (isUnsupportedVersion) {
if (!scalaVersion.startsWith("3."))
logger.debug(Feedback.skippedUnsupportedScalaMetals(scalaVersion))(DebugFilter.All)
val isSupportedVersion =
scalaSemanticdbSettings.supportedScalaVersions.exists(scalaVersion.startsWith(_))
if (scalaVersion.startsWith("3.")) {
None
} else {
SemanticDBCache.fetchScalaPlugin(
Expand All @@ -220,9 +218,13 @@ object BuildLoader {
case Right(path) =>
logger.debug(Feedback.configuredMetalsScalaProjects(projects))(DebugFilter.All)
Some(path)
case Left(cause) =>
case Left(cause) if isSupportedVersion =>
logger.displayWarningToUser(Feedback.failedMetalsScalaConfiguration(scalaVersion, cause))
None

// We try to download anyway, but don't print the exception
case _ =>
None
}
}
}
Expand Down

0 comments on commit 0365836

Please sign in to comment.