Skip to content

Commit d5bf957

Browse files
committed
impl: initialize and pass the feed manager to URI handler
To be used later for resolving the placeholders.
1 parent a871581 commit d5bf957

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.coder.toolbox
22

33
import com.coder.toolbox.browser.browse
44
import com.coder.toolbox.cli.CoderCLIManager
5+
import com.coder.toolbox.feed.IdeFeedManager
56
import com.coder.toolbox.plugin.PluginManager
67
import com.coder.toolbox.sdk.CoderRestClient
78
import com.coder.toolbox.sdk.ex.APIResponseException
@@ -96,7 +97,7 @@ class CoderRemoteProvider(
9697
providerVisible = false
9798
)
9899
)
99-
private val linkHandler = CoderProtocolHandler(context)
100+
private val linkHandler = CoderProtocolHandler(context, IdeFeedManager(context))
100101

101102
override val loadingEnvironmentsDescription: LocalizableString = context.i18n.ptrl("Loading workspaces...")
102103
override val environments: MutableStateFlow<LoadableState<List<CoderRemoteEnvironment>>> = MutableStateFlow(

src/main/kotlin/com/coder/toolbox/util/CoderProtocolHandler.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.coder.toolbox.util
22

33
import com.coder.toolbox.CoderToolboxContext
44
import com.coder.toolbox.cli.CoderCLIManager
5+
import com.coder.toolbox.feed.IdeFeedManager
56
import com.coder.toolbox.models.WorkspaceAndAgentStatus
67
import com.coder.toolbox.sdk.CoderRestClient
78
import com.coder.toolbox.sdk.v2.models.Workspace
@@ -26,6 +27,7 @@ private const val CAN_T_HANDLE_URI_TITLE = "Can't handle URI"
2627
@Suppress("UnstableApiUsage")
2728
open class CoderProtocolHandler(
2829
private val context: CoderToolboxContext,
30+
ideFeedManager: IdeFeedManager,
2931
) {
3032
private val settings = context.settingsStore.readOnly()
3133

src/test/kotlin/com/coder/toolbox/util/CoderProtocolHandlerTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.coder.toolbox.util
22

33
import com.coder.toolbox.CoderToolboxContext
4+
import com.coder.toolbox.feed.IdeFeedManager
45
import com.coder.toolbox.sdk.DataGen
56
import com.coder.toolbox.settings.Environment
67
import com.coder.toolbox.store.CoderSecretsStore
@@ -54,7 +55,8 @@ internal class CoderProtocolHandlerTest {
5455
)
5556

5657
private val protocolHandler = CoderProtocolHandler(
57-
context
58+
context,
59+
IdeFeedManager(context)
5860
)
5961

6062
@Test

0 commit comments

Comments
 (0)