Skip to content

Commit af6f395

Browse files
committed
Display "Gitpod Workspace: <WORKSPACE_ID>" on the top-left NavBar from JetBrains IDEs
1 parent dab8e98 commit af6f395

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

components/ide/jetbrains/backend-plugin/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pluginUntilBuild=221.*
1212
pluginVerifierIdeVersions=2021.3, 2022.1
1313
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1414
platformType=IU
15-
platformVersion=221.4994-EAP-CANDIDATE-SNAPSHOT
15+
platformVersion=221-EAP-SNAPSHOT
1616
platformDownloadSources=true
1717
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1818
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package io.gitpod.jetbrains.remote
2+
3+
import com.jetbrains.rdserver.unattendedHost.customization.GatewayClientCustomizationProvider
4+
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.DefaultGatewayControlCenterProvider
5+
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.GatewayControlCenterProvider
6+
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.GatewayHostnameDisplayKind
7+
import io.gitpod.jetbrains.remote.icons.GitpodIcons
8+
import javax.swing.Icon
9+
10+
class GitpodGatewayClientCustomizationProvider : GatewayClientCustomizationProvider {
11+
override val icon: Icon = GitpodIcons.Logo
12+
override val title: String = "Gitpod Workspace"
13+
14+
override val controlCenter: GatewayControlCenterProvider = object : GatewayControlCenterProvider {
15+
override fun getHostnameDisplayKind() = GatewayHostnameDisplayKind.ShowHostnameOnNavbar
16+
override fun getHostnameShort() = if (System.getenv("GITPOD_WORKSPACE_ID") != null) {
17+
title + ": " + System.getenv("GITPOD_WORKSPACE_ID")
18+
} else {
19+
title
20+
}
21+
override fun getHostnameLong() = getHostnameShort()
22+
}
23+
}
24+

components/ide/jetbrains/backend-plugin/src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<projectService serviceImplementation="io.gitpod.jetbrains.remote.GitpodClientProjectSessionTracker" client="guest" preload="true"/>
2929
<projectService serviceImplementation="io.gitpod.jetbrains.remote.GitpodTerminalService" preload="true"/>
3030
<projectService serviceImplementation="io.gitpod.jetbrains.remote.GitpodProjectManager" preload="true"/>
31+
<gateway.customization.name implementation="io.gitpod.jetbrains.remote.GitpodGatewayClientCustomizationProvider"/>
3132
</extensions>
3233

3334
</idea-plugin>

0 commit comments

Comments
 (0)