Skip to content

Commit 8c3b701

Browse files
committed
Add "Check for IDE updates" setting
This setting controls whether the plugin checks for available backend IDE upgrades (on by default). Turning it off suppresses the prompt to upgrade to a newer version.
1 parent 077fd6f commit 8c3b701

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class CoderRemoteConnectionHandle {
9393
},
9494
true,
9595
)
96-
if (attempt == 1) {
96+
if (settings.checkIDEUpdate && attempt == 1) {
9797
// See if there is a newer (non-EAP) version of the IDE available.
9898
checkUpdate(accessor, parameters, indicator)?.let { update ->
9999
// Store the old IDE to delete later.

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ class CoderSettingsConfigurable : BoundConfigurable("Coder") {
157157
"Example format: CL 2023.3.6 233.15619.8",
158158
)
159159
}
160+
row(CoderGatewayBundle.message("gateway.connector.settings.check-ide-updates.heading")) {
161+
checkBox(CoderGatewayBundle.message("gateway.connector.settings.check-ide-updates.title"))
162+
.bindSelected(state::checkIDEUpdates)
163+
.comment(
164+
CoderGatewayBundle.message("gateway.connector.settings.check-ide-updates.comment"),
165+
)
166+
}.layout(RowLayout.PARENT_GRID)
160167
}
161168
}
162169

src/main/kotlin/com/coder/gateway/settings/CoderSettings.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ open class CoderSettingsState(
102102
open var workspaceFilter: String = "owner:me",
103103
// Default version of IDE to display in IDE selection dropdown
104104
open var defaultIde: String = "",
105+
// Whether to check for IDE updates.
106+
open var checkIDEUpdates: Boolean = true,
105107
)
106108

107109
/**
@@ -182,6 +184,12 @@ open class CoderSettings(
182184
val defaultIde: String
183185
get() = state.defaultIde
184186

187+
/**
188+
* Whether to check for IDE updates.
189+
*/
190+
val checkIDEUpdate: Boolean
191+
get() = state.checkIDEUpdates
192+
185193
/**
186194
* Whether to ignore a failed setup command.
187195
*/

src/main/resources/messages/CoderGatewayBundle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,9 @@ gateway.connector.settings.workspace-filter.comment=The filter to apply when \
139139
which can be slow with many workspaces, and it adds every agent to the SSH \
140140
config, which can result in a large SSH config with many workspaces.
141141
gateway.connector.settings.default-ide=Default IDE Selection
142+
gateway.connector.settings.check-ide-updates.heading=IDE version check
143+
gateway.connector.settings.check-ide-updates.title=Check for IDE updates
144+
gateway.connector.settings.check-ide-updates.comment=Checking this box will \
145+
cause the plugin to check for available IDE backend updates and prompt \
146+
with an option to upgrade if a newer version is available.
147+

0 commit comments

Comments
 (0)