Skip to content

Commit 388d47e

Browse files
committed
Rename ideProductCode to ideProduct
For example, ideProductCode.productCode is a bit weird. This object contains more than just the product code. It is still ideProductCode in the recent connections file because there we do indeed only store the product code, but also we cannot change the name there anyway to avoid breaking backwards compatibility.
1 parent fed13e8 commit 388d47e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/main/kotlin/com/coder/gateway/CoderRemoteConnectionHandle.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class CoderRemoteConnectionHandle {
161161
indicator.text = "Waiting for ${workspace.ideName} backend..."
162162
var status: UnattendedHostStatus? = null
163163
val remoteProjectPath = accessor.makeRemotePath(ShellArgument.PlainText(workspace.projectPath))
164-
val logsDir = accessor.getLogsDir(workspace.ideProductCode.productCode, remoteProjectPath)
164+
val logsDir = accessor.getLogsDir(workspace.ideProduct.productCode, remoteProjectPath)
165165
while (lifetime.status == LifetimeStatus.Alive) {
166166
status = ensureIDEBackend(workspace, accessor, ideDir, remoteProjectPath, logsDir, lifetime, null)
167167
if (!status?.joinLink.isNullOrBlank()) {
@@ -262,7 +262,7 @@ class CoderRemoteConnectionHandle {
262262
logger.info("Searching for ${workspace.ideName} on ${workspace.hostname}")
263263
val installed =
264264
accessor.getInstalledIDEs().find {
265-
it.product == workspace.ideProductCode && it.buildNumber == workspace.ideBuildNumber
265+
it.product == workspace.ideProduct && it.buildNumber == workspace.ideBuildNumber
266266
}
267267
if (installed != null) {
268268
logger.info("${workspace.ideName} found at ${workspace.hostname}:${installed.pathToIde}")

src/main/kotlin/com/coder/gateway/models/WorkspaceProjectIDE.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class WorkspaceProjectIDE(
1616
val name: String,
1717
val hostname: String,
1818
val projectPath: String,
19-
val ideProductCode: IntelliJPlatformProduct,
19+
val ideProduct: IntelliJPlatformProduct,
2020
val ideBuildNumber: String,
2121
// One of these must exist; enforced by the constructor.
2222
var idePathOnHost: String?,
@@ -25,7 +25,7 @@ class WorkspaceProjectIDE(
2525
val deploymentURL: URL,
2626
var lastOpened: String?, // Null if never opened.
2727
) {
28-
val ideName = "${ideProductCode.productCode}-$ideBuildNumber"
28+
val ideName = "${ideProduct.productCode}-$ideBuildNumber"
2929

3030
private val maxDisplayLength = 35
3131

@@ -53,7 +53,7 @@ class WorkspaceProjectIDE(
5353
name = name,
5454
coderWorkspaceHostname = hostname,
5555
projectPath = projectPath,
56-
ideProductCode = ideProductCode.productCode,
56+
ideProductCode = ideProduct.productCode,
5757
ideBuildNumber = ideBuildNumber,
5858
downloadSource = downloadSource,
5959
idePathOnHost = idePathOnHost,
@@ -98,7 +98,7 @@ class WorkspaceProjectIDE(
9898
name = name,
9999
hostname = hostname,
100100
projectPath = projectPath,
101-
ideProductCode = IntelliJPlatformProduct.fromProductCode(ideProductCode) ?: throw Exception("invalid product code"),
101+
ideProduct = IntelliJPlatformProduct.fromProductCode(ideProductCode) ?: throw Exception("invalid product code"),
102102
ideBuildNumber = ideBuildNumber,
103103
idePathOnHost = idePathOnHost,
104104
downloadSource = downloadSource,
@@ -172,7 +172,7 @@ fun IdeWithStatus.withWorkspaceProject(
172172
name = name,
173173
hostname = hostname,
174174
projectPath = projectPath,
175-
ideProductCode = this.product,
175+
ideProduct = this.product,
176176
ideBuildNumber = this.buildNumber,
177177
downloadSource = this.download?.link,
178178
idePathOnHost = this.pathOnHost,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
287287
}
288288
connections.forEach { workspaceProjectIDE ->
289289
row {
290-
icon(workspaceProjectIDE.ideProductCode.icon)
290+
icon(workspaceProjectIDE.ideProduct.icon)
291291
cell(
292292
ActionLink(workspaceProjectIDE.projectPathDisplay) {
293293
CoderRemoteConnectionHandle().connect { workspaceProjectIDE }

0 commit comments

Comments
 (0)