@@ -16,7 +16,6 @@ import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateConsumer
16
16
import com.jetbrains.toolbox.api.ui.ToolboxUi
17
17
import kotlinx.coroutines.CoroutineScope
18
18
import kotlinx.coroutines.launch
19
- import java.util.concurrent.CompletableFuture
20
19
21
20
/* *
22
21
* Represents an agent and workspace combination.
@@ -29,12 +28,12 @@ class CoderRemoteEnvironment(
29
28
private var workspace : Workspace ,
30
29
private var agent : WorkspaceAgent ,
31
30
private var cs : CoroutineScope ,
32
- ) : AbstractRemoteProviderEnvironment() {
31
+ ) : AbstractRemoteProviderEnvironment(" ${workspace.name} . ${agent.name} " ) {
33
32
private var status = WorkspaceAndAgentStatus .from(workspace, agent)
34
33
35
34
private val ui: ToolboxUi = serviceLocator.getService(ToolboxUi ::class .java)
36
- override fun getId (): String = " ${workspace.name} . ${agent.name} "
37
- override fun getName () : String = " ${workspace.name} .${agent.name} "
35
+
36
+ override var name : String = " ${workspace.name} .${agent.name} "
38
37
39
38
init {
40
39
actionsList.add(
@@ -105,12 +104,11 @@ class CoderRemoteEnvironment(
105
104
* The contents are provided by the SSH view provided by Toolbox, all we
106
105
* have to do is provide it a host name.
107
106
*/
108
- override fun getContentsView (): CompletableFuture <EnvironmentContentsView > =
109
- CompletableFuture .completedFuture(EnvironmentView (client.url, workspace, agent))
107
+ override suspend fun getContentsView (): EnvironmentContentsView = EnvironmentView (client.url, workspace, agent)
110
108
111
109
/* *
112
- * Does nothing. In theory we could do something like start the workspace
113
- * when you click into the workspace but you would still need to press
110
+ * Does nothing. In theory, we could do something like start the workspace
111
+ * when you click into the workspace, but you would still need to press
114
112
* "connect" anyway before the content is populated so there does not seem
115
113
* to be much value.
116
114
*/
@@ -140,12 +138,12 @@ class CoderRemoteEnvironment(
140
138
if (other == null ) return false
141
139
if (this == = other) return true // Note the triple ===
142
140
if (other !is CoderRemoteEnvironment ) return false
143
- if (getId() != other.getId() ) return false
141
+ if (id != other.id ) return false
144
142
return true
145
143
}
146
144
147
145
/* *
148
146
* Companion to equals, for sets.
149
147
*/
150
- override fun hashCode (): Int = getId() .hashCode()
148
+ override fun hashCode (): Int = id .hashCode()
151
149
}
0 commit comments