@@ -27,7 +27,6 @@ import com.intellij.openapi.util.Disposer
27
27
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenUIManager
28
28
import com.intellij.remote.AuthType
29
29
import com.intellij.remote.RemoteCredentialsHolder
30
- import com.intellij.ssh.SshException
31
30
import com.intellij.ui.AnimatedIcon
32
31
import com.intellij.ui.ColoredListCellRenderer
33
32
import com.intellij.ui.DocumentAdapter
@@ -57,7 +56,6 @@ import kotlinx.coroutines.CancellationException
57
56
import kotlinx.coroutines.CoroutineScope
58
57
import kotlinx.coroutines.Dispatchers
59
58
import kotlinx.coroutines.Job
60
- import kotlinx.coroutines.TimeoutCancellationException
61
59
import kotlinx.coroutines.async
62
60
import kotlinx.coroutines.cancel
63
61
import kotlinx.coroutines.cancelAndJoin
@@ -107,6 +105,7 @@ class CoderLocateRemoteProjectStepView(private val setNextButtonEnabled: (Boolea
107
105
setNextButtonEnabled(this .selectedItem != null )
108
106
ApplicationManager .getApplication().invokeLater {
109
107
logger.info(" Selected IDE: ${this .selectedItem} " )
108
+ cbIDEComment.foreground = UIUtil .getContextHelpForeground()
110
109
when (this .selectedItem?.status) {
111
110
IdeStatus .ALREADY_INSTALLED ->
112
111
cbIDEComment.text =
@@ -156,6 +155,10 @@ class CoderLocateRemoteProjectStepView(private val setNextButtonEnabled: (Boolea
156
155
override val nextActionText = CoderGatewayBundle .message(" gateway.connector.view.coder.remoteproject.next.text" )
157
156
158
157
override fun onInit (wizardModel : CoderWorkspacesWizardModel ) {
158
+ // Clear error message as it might still be displaying.
159
+ cbIDEComment.foreground = UIUtil .getContextHelpForeground()
160
+ cbIDEComment.text = CoderGatewayBundle .message(" gateway.connector.view.coder.remoteproject.ide.none.comment" )
161
+
159
162
cbIDE.renderer = IDECellRenderer ()
160
163
ideComboBoxModel.removeAllElements()
161
164
val deploymentURL = wizardModel.coderURL.toURL()
@@ -183,30 +186,17 @@ class CoderLocateRemoteProjectStepView(private val setNextButtonEnabled: (Boolea
183
186
when (e) {
184
187
is InterruptedException -> Unit
185
188
is CancellationException -> Unit
186
- is TimeoutCancellationException ,
187
- is SshException -> {
188
- logger.error(" Can't connect to workspace ${selectedWorkspace.name} . Reason: $e " )
189
- withContext(Dispatchers .Main ) {
190
- setNextButtonEnabled(false )
191
- cbIDE.renderer = object : ColoredListCellRenderer <IdeWithStatus >() {
192
- override fun customizeCellRenderer (list : JList <out IdeWithStatus >, value : IdeWithStatus ? , index : Int , isSelected : Boolean , cellHasFocus : Boolean ) {
193
- background = UIUtil .getListBackground(isSelected, cellHasFocus)
194
- icon = UIUtil .getBalloonErrorIcon()
195
- append(CoderGatewayBundle .message(" gateway.connector.view.coder.remoteproject.ssh.error.text" ))
196
- }
197
- }
198
- }
199
- }
200
-
201
189
else -> {
202
- logger.error(" Could not resolve any IDE for workspace ${selectedWorkspace.name} . Reason: $e " )
190
+ logger.error(" Failed to retrieve IDEs for workspace ${selectedWorkspace.name} " , e )
203
191
withContext(Dispatchers .Main ) {
204
192
setNextButtonEnabled(false )
193
+ cbIDEComment.foreground = UIUtil .getErrorForeground()
194
+ cbIDEComment.text = e.message ? : " The error did not provide any further details"
205
195
cbIDE.renderer = object : ColoredListCellRenderer <IdeWithStatus >() {
206
196
override fun customizeCellRenderer (list : JList <out IdeWithStatus >, value : IdeWithStatus ? , index : Int , isSelected : Boolean , cellHasFocus : Boolean ) {
207
197
background = UIUtil .getListBackground(isSelected, cellHasFocus)
208
198
icon = UIUtil .getBalloonErrorIcon()
209
- append(CoderGatewayBundle .message(" gateway.connector.view.coder.remoteproject.ide. error.text" ))
199
+ append(CoderGatewayBundle .message(" gateway.connector.view.coder.remoteproject.error.text" ))
210
200
}
211
201
}
212
202
}
@@ -217,7 +207,7 @@ class CoderLocateRemoteProjectStepView(private val setNextButtonEnabled: (Boolea
217
207
}
218
208
219
209
private fun installRemotePathValidator (executor : HighLevelHostAccessor ) {
220
- var disposable = Disposer .newDisposable(ApplicationManager .getApplication(), CoderLocateRemoteProjectStepView .javaClass .name)
210
+ val disposable = Disposer .newDisposable(ApplicationManager .getApplication(), CoderLocateRemoteProjectStepView :: class .java .name)
221
211
ComponentValidator (disposable).installOn(tfProject)
222
212
223
213
tfProject.document.addDocumentListener(object : DocumentAdapter () {
0 commit comments