Skip to content

Commit b15d5f9

Browse files
committed
Fix: build with Gateway 2022.3 RC API
1 parent 183bd97 commit b15d5f9

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## Unreleased
66

7+
### Added
8+
- support for Gateway 2022.3 RC
9+
710
## 2.1.2 - 2022-11-23
811

912
### Added

src/main/kotlin/com/coder/gateway/sdk/os.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.coder.gateway.sdk
22

3+
import java.util.Locale
4+
35
fun getOS(): OS? {
46
return OS.from(System.getProperty("os.name"))
57
}
68

79
fun getArch(): Arch? {
8-
return Arch.from(System.getProperty("os.arch").toLowerCase())
10+
return Arch.from(System.getProperty("os.arch").lowercase(Locale.getDefault()))
911
}
1012

1113
enum class OS {

src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import kotlinx.coroutines.cancel
3737
import kotlinx.coroutines.launch
3838
import java.awt.Component
3939
import java.awt.Dimension
40+
import java.util.Locale
4041
import javax.swing.JComponent
4142
import javax.swing.JLabel
4243
import javax.swing.event.DocumentEvent
@@ -70,7 +71,7 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
7071
addDocumentListener(object : DocumentAdapter() {
7172
override fun textChanged(e: DocumentEvent) {
7273
val toSearchFor = this@applyToComponent.text
73-
val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.toLowerCase()?.contains(toSearchFor) ?: false || it.projectPath?.toLowerCase()?.contains(toSearchFor) ?: false }
74+
val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.lowercase(Locale.getDefault())?.contains(toSearchFor) ?: false || it.projectPath?.lowercase(Locale.getDefault())?.contains(toSearchFor) ?: false }
7475
updateContentView(filteredConnections.groupBy { it.coderWorkspaceHostname })
7576
}
7677
})

src/main/kotlin/com/coder/gateway/views/steps/CoderLocateRemoteProjectStepView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ import com.jetbrains.gateway.ssh.HighLevelHostAccessor
3434
import com.jetbrains.gateway.ssh.IdeStatus
3535
import com.jetbrains.gateway.ssh.IdeWithStatus
3636
import com.jetbrains.gateway.ssh.IntelliJPlatformProduct
37-
import com.jetbrains.gateway.ssh.deploy.guessOs
3837
import kotlinx.coroutines.CoroutineScope
3938
import kotlinx.coroutines.Dispatchers
4039
import kotlinx.coroutines.cancel
4140
import kotlinx.coroutines.launch
4241
import kotlinx.coroutines.withContext
4342
import java.awt.Component
4443
import java.awt.FlowLayout
44+
import java.util.Locale
4545
import javax.swing.ComboBoxModel
4646
import javax.swing.DefaultComboBoxModel
4747
import javax.swing.JLabel
@@ -125,7 +125,7 @@ class CoderLocateRemoteProjectStepView(private val disableNextAction: () -> Unit
125125
HighLevelHostAccessor.create(
126126
credentialsHolder,
127127
true
128-
).hostCommandExecutor.guessOs()
128+
).guessOs()
129129
} catch (e: Exception) {
130130
logger.error("Could not resolve any IDE for workspace ${selectedWorkspace.name}. Reason: $e")
131131
null
@@ -235,7 +235,7 @@ class CoderLocateRemoteProjectStepView(private val disableNextAction: () -> Unit
235235
JPanel().apply {
236236
layout = FlowLayout(FlowLayout.LEFT)
237237
add(JLabel(ideWithStatus.product.ideName, ideWithStatus.product.icon, SwingConstants.LEFT))
238-
add(JLabel("${ideWithStatus.product.productCode} ${ideWithStatus.presentableVersion} ${ideWithStatus.buildNumber} | ${ideWithStatus.status.name.toLowerCase()}").apply {
238+
add(JLabel("${ideWithStatus.product.productCode} ${ideWithStatus.presentableVersion} ${ideWithStatus.buildNumber} | ${ideWithStatus.status.name.lowercase(Locale.getDefault())}").apply {
239239
foreground = UIUtil.getLabelDisabledForeground()
240240
})
241241
background = UIUtil.getListBackground(isSelected, cellHasFocus)

0 commit comments

Comments
 (0)