@@ -16,7 +16,6 @@ import com.intellij.openapi.roots.ui.configuration.SdkLookupProvider
16
16
import com .intellij .openapi .roots .ui .configuration .SdkLookupProvider .SdkInfo
17
17
import org .jetbrains .plugins .scala .extensions .ObjectExt
18
18
import org .jetbrains .sbt .SbtBundle
19
- import org .jetbrains .sbt .project .settings .SbtProjectSettings
20
19
import org .jetbrains .sbt .settings .SbtSettings
21
20
22
21
class SbtExecutionAware extends ExternalSystemExecutionAware {
@@ -48,19 +47,18 @@ class SbtExecutionAware extends ExternalSystemExecutionAware {
48
47
// the import does not wait for the download to finish.
49
48
// 2. After resolution we can verify if the JDK is correct - it could be useful because, currently,
50
49
// if the SDK is resolved but broken, no meaningful message is displayed.
51
- resolveJdk(project, projectSettings, externalSystemTask, taskNotificationListener)
50
+ resolveJdk(project, externalSystemTask, taskNotificationListener)
52
51
}
53
52
54
53
private def resolveJdk (
55
54
project : Project ,
56
- projectSettings : SbtProjectSettings ,
57
55
task : ExternalSystemTask ,
58
56
taskNotificationListener : ExternalSystemTaskNotificationListener ,
59
57
): Unit = {
60
58
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 ) {
64
62
waitForJvmResolving(provider, task, taskNotificationListener)
65
63
}
66
64
}
@@ -127,15 +125,9 @@ class SbtExecutionAware extends ExternalSystemExecutionAware {
127
125
128
126
private def nonblockingResolveJdk (
129
127
provider : SdkLookupProvider ,
130
- project : Project ,
131
- projectSettingsJdkName : Option [String ]
128
+ project : Project
132
129
): SdkInfo = {
133
- val jdkReference = projectSettingsJdkName match {
134
- case Some (value) => value
135
- case None => ExternalSystemJdkUtil .USE_PROJECT_JDK
136
- }
137
-
138
130
val projectSdk = ProjectRootManager .getInstance(project).getProjectSdk
139
- ExternalSystemJdkUtilKt .nonblockingResolveJdkInfo(provider, projectSdk, jdkReference )
131
+ ExternalSystemJdkUtilKt .nonblockingResolveJdkInfo(provider, projectSdk, ExternalSystemJdkUtil . USE_PROJECT_JDK )
140
132
}
141
133
}
0 commit comments