File tree 2 files changed +39
-0
lines changed
components/ide/jetbrains/backend-plugin/src/main
kotlin/io/gitpod/jetbrains/remote 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
+ // Licensed under the GNU Affero General Public License (AGPL).
3
+ // See License-AGPL.txt in the project root for license information.
4
+
5
+ package io.gitpod.jetbrains.remote
6
+
7
+ import com.intellij.openapi.diagnostic.thisLogger
8
+ import com.intellij.openapi.project.Project
9
+ import com.intellij.openapi.projectRoots.ProjectJdkTable
10
+ import com.intellij.openapi.roots.ProjectRootManager
11
+ import com.intellij.util.application
12
+
13
+ class GitpodProjectManager (
14
+ private val project : Project
15
+ ) {
16
+
17
+ init {
18
+ application.invokeLaterOnWriteThread {
19
+ application.runWriteAction {
20
+ configureSdk()
21
+ }
22
+ }
23
+ }
24
+
25
+ /* *
26
+ * It is a workaround for https://youtrack.jetbrains.com/issue/GTW-88
27
+ */
28
+ private fun configureSdk () {
29
+ ProjectJdkTable .getInstance().preconfigure()
30
+ val sdk = ProjectJdkTable .getInstance().allJdks.firstOrNull() ? : return
31
+ val projectRootManager = ProjectRootManager .getInstance(project)
32
+ if (projectRootManager.projectSdk != null ) {
33
+ return
34
+ }
35
+ projectRootManager.projectSdk = sdk
36
+ thisLogger().warn(" gitpod: SDK was auto preconfigured: $sdk " )
37
+ }
38
+ }
Original file line number Diff line number Diff line change 25
25
<applicationService serviceImplementation =" io.gitpod.jetbrains.remote.GitpodBranding"
26
26
serviceInterface =" com.intellij.remoteDev.customization.GatewayBranding"
27
27
overrides =" true" />
28
+ <projectService serviceImplementation =" io.gitpod.jetbrains.remote.GitpodProjectManager" preload =" true" />
28
29
</extensions >
29
30
30
31
</idea-plugin >
You can’t perform that action at this time.
0 commit comments