Skip to content

Commit d181f09

Browse files
author
builduser
committed
Merged branch idea251.release into idea251.x
2 parents b624446 + fb33187 commit d181f09

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

sbt/sbt-impl/src/org/jetbrains/sbt/project/execution/SbtExecutionAware.scala

+6-14
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import com.intellij.openapi.roots.ui.configuration.SdkLookupProvider
1616
import com.intellij.openapi.roots.ui.configuration.SdkLookupProvider.SdkInfo
1717
import org.jetbrains.plugins.scala.extensions.ObjectExt
1818
import org.jetbrains.sbt.SbtBundle
19-
import org.jetbrains.sbt.project.settings.SbtProjectSettings
2019
import org.jetbrains.sbt.settings.SbtSettings
2120

2221
class SbtExecutionAware extends ExternalSystemExecutionAware {
@@ -48,19 +47,18 @@ class SbtExecutionAware extends ExternalSystemExecutionAware {
4847
// the import does not wait for the download to finish.
4948
// 2. After resolution we can verify if the JDK is correct - it could be useful because, currently,
5049
// if the SDK is resolved but broken, no meaningful message is displayed.
51-
resolveJdk(project, projectSettings, externalSystemTask, taskNotificationListener)
50+
resolveJdk(project, externalSystemTask, taskNotificationListener)
5251
}
5352

5453
private def resolveJdk(
5554
project: Project,
56-
projectSettings: SbtProjectSettings,
5755
task: ExternalSystemTask,
5856
taskNotificationListener: ExternalSystemTaskNotificationListener,
5957
): Unit = {
6058
val provider = SdkLookupProvider.getInstance(project, DefaultSdkLookupId)
61-
val sdkInfo = nonblockingResolveJdk(provider, project, projectSettings.jdkName)
62-
val isResolved = sdkInfo.is[SdkInfo.Resolved]
63-
if (!isResolved) {
59+
val sdkInfo = nonblockingResolveJdk(provider, project)
60+
val isResolving = sdkInfo.is[SdkInfo.Resolving]
61+
if (isResolving) {
6462
waitForJvmResolving(provider, task, taskNotificationListener)
6563
}
6664
}
@@ -127,15 +125,9 @@ class SbtExecutionAware extends ExternalSystemExecutionAware {
127125

128126
private def nonblockingResolveJdk(
129127
provider: SdkLookupProvider,
130-
project: Project,
131-
projectSettingsJdkName: Option[String]
128+
project: Project
132129
): SdkInfo = {
133-
val jdkReference = projectSettingsJdkName match {
134-
case Some(value) => value
135-
case None => ExternalSystemJdkUtil.USE_PROJECT_JDK
136-
}
137-
138130
val projectSdk = ProjectRootManager.getInstance(project).getProjectSdk
139-
ExternalSystemJdkUtilKt.nonblockingResolveJdkInfo(provider, projectSdk, jdkReference)
131+
ExternalSystemJdkUtilKt.nonblockingResolveJdkInfo(provider, projectSdk, ExternalSystemJdkUtil.USE_PROJECT_JDK)
140132
}
141133
}

0 commit comments

Comments
 (0)