Skip to content

Commit e5f734d

Browse files
authored
deps(amazonq): Add registry entry for endpoint (#5838)
1 parent 7de4138 commit e5f734d

File tree

2 files changed

+9
-3
lines changed
  • plugins/amazonq
    • shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/artifacts
    • src/main/resources/META-INF

2 files changed

+9
-3
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/artifacts/ManifestFetcher.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
77
import com.fasterxml.jackson.databind.DeserializationFeature
88
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
99
import com.fasterxml.jackson.module.kotlin.readValue
10+
import com.intellij.openapi.util.registry.Registry
1011
import org.jetbrains.annotations.VisibleForTesting
1112
import software.aws.toolkits.core.utils.deleteIfExists
1213
import software.aws.toolkits.core.utils.error
@@ -21,15 +22,17 @@ import software.aws.toolkits.jetbrains.core.saveFileFromUrl
2122
import java.nio.file.Path
2223

2324
class ManifestFetcher(
24-
private val lspManifestUrl: String = DEFAULT_MANIFEST_URL,
25+
private val lspManifestUrl: String = getManifestEndpoint(),
2526
private val manifestPath: Path = DEFAULT_MANIFEST_PATH,
2627
) {
2728
companion object {
2829
private val mapper = jacksonObjectMapper().apply { configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) }
2930
private val logger = getLogger<ManifestFetcher>()
3031

31-
private const val DEFAULT_MANIFEST_URL =
32-
"https://aws-toolkit-language-servers.amazonaws.com/qAgenticChatServer/0/manifest.json"
32+
private fun getManifestEndpoint(): String {
33+
val endpoint = Registry.get("amazon.q.flare.endpoint").asString()
34+
return endpoint.ifBlank { "https://aws-toolkit-language-servers.amazonaws.com/qAgenticChatServer/0/manifest.json" }
35+
}
3336

3437
private val DEFAULT_MANIFEST_PATH: Path = getToolkitsCommonCacheRoot()
3538
.resolve("aws")

plugins/amazonq/src/main/resources/META-INF/plugin.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
restartRequired="true"/>
7575
<registryKey key="inline.completion.rem.dev.use.rhizome" description="Defined by IntelliJ. Used for Amazon Q to display suggestions on remote."
7676
defaultValue="false" restartRequired="true"/>
77+
<registryKey defaultValue=""
78+
description="Endpoint to use to download flare artifacts"
79+
key="amazon.q.flare.endpoint"/>
7780
</extensions>
7881

7982
<extensionPoints>

0 commit comments

Comments
 (0)