Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit069277c

Browse files
committed
Fix connection not running from editor
I think we could get it working with the same trick as the IDE resolvingjob but it seems like there is no need for the launches anyway?
1 parentb80e8c2 commit069277c

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ import com.jetbrains.gateway.ssh.SshDeployFlowUtil
3131
importcom.jetbrains.gateway.ssh.SshMultistagePanelContext
3232
importcom.jetbrains.gateway.ssh.deploy.DeployException
3333
importcom.jetbrains.rd.util.lifetime.LifetimeDefinition
34-
importkotlinx.coroutines.GlobalScope
35-
importkotlinx.coroutines.launch
3634
importnet.schmizz.sshj.common.SSHException
3735
importnet.schmizz.sshj.connection.ConnectionException
3836
importjava.awt.Dimension
@@ -48,7 +46,7 @@ import javax.net.ssl.SSLHandshakeException
4846
classCoderRemoteConnectionHandle {
4947
privateval recentConnectionsService= service<CoderRecentWorkspaceConnectionsService>()
5048

51-
suspendfunconnect(getParameters: (indicator:ProgressIndicator)->Map<String,String>) {
49+
funconnect(getParameters: (indicator:ProgressIndicator)->Map<String,String>) {
5250
val clientLifetime=LifetimeDefinition()
5351
clientLifetime.launchUnderBackgroundProgress(CoderGatewayBundle.message("gateway.connector.coder.connection.provider.title")) {
5452
try {
@@ -79,13 +77,11 @@ class CoderRemoteConnectionHandle {
7977
indicator.text=CoderGatewayBundle.message("gateway.connector.coder.connecting.failed.retry", humanizeDuration(remainingMs))
8078
},
8179
)
82-
GlobalScope.launch {
83-
logger.info("Deploying and starting IDE with$context")
84-
// At this point JetBrains takes over with their own UI.
85-
@Suppress("UnstableApiUsage")SshDeployFlowUtil.fullDeployCycle(
86-
clientLifetime, context,Duration.ofMinutes(10)
87-
)
88-
}
80+
logger.info("Deploying and starting IDE with$context")
81+
// At this point JetBrains takes over with their own UI.
82+
@Suppress("UnstableApiUsage")SshDeployFlowUtil.fullDeployCycle(
83+
clientLifetime, context,Duration.ofMinutes(10)
84+
)
8985
recentConnectionsService.addRecentConnection(parameters.toRecentWorkspaceConnection())
9086
}catch (e:Exception) {
9187
if (isCancellation(e)) {

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,8 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
212212
row {
213213
icon(product.icon)
214214
cell(ActionLink(connectionDetails.projectPath!!) {
215-
cs.launch {
216-
CoderRemoteConnectionHandle().connect{ connectionDetails.toWorkspaceParams() }
217-
GatewayUI.getInstance().reset()
218-
}
215+
CoderRemoteConnectionHandle().connect{ connectionDetails.toWorkspaceParams() }
216+
GatewayUI.getInstance().reset()
219217
})
220218
label("").resizableColumn().align(AlignX.FILL)
221219
label("Last opened:${connectionDetails.lastOpened}").applyToComponent {

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ import kotlinx.coroutines.Dispatchers
6767
importkotlinx.coroutines.Job
6868
importkotlinx.coroutines.async
6969
importkotlinx.coroutines.cancel
70-
importkotlinx.coroutines.cancelAndJoin
7170
importkotlinx.coroutines.launch
7271
importkotlinx.coroutines.runBlocking
7372
importkotlinx.coroutines.withContext
@@ -340,18 +339,16 @@ class CoderLocateRemoteProjectStepView(private val setNextButtonEnabled: (Boolea
340339
logger.warn("No workspace was selected. Please go back to the previous step and select a workspace")
341340
returnfalse
342341
}
343-
cs.launch {
344-
CoderRemoteConnectionHandle().connect{
345-
selectedIDE
346-
.toWorkspaceParams()
347-
.withWorkspaceHostname(CoderCLIManager.getHostName(deploymentURL, selectedWorkspace))
348-
.withProjectPath(tfProject.text)
349-
.withWebTerminalLink("${terminalLink.url}")
350-
.withConfigDirectory(wizardModel.configDirectory)
351-
.withName(selectedWorkspace.name)
352-
}
353-
GatewayUI.getInstance().reset()
342+
CoderRemoteConnectionHandle().connect{
343+
selectedIDE
344+
.toWorkspaceParams()
345+
.withWorkspaceHostname(CoderCLIManager.getHostName(deploymentURL, selectedWorkspace))
346+
.withProjectPath(tfProject.text)
347+
.withWebTerminalLink("${terminalLink.url}")
348+
.withConfigDirectory(wizardModel.configDirectory)
349+
.withName(selectedWorkspace.name)
354350
}
351+
GatewayUI.getInstance().reset()
355352
returntrue
356353
}
357354

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp