Skip to content

Commit 04fd7f1

Browse files
authored
Merge branch 'main' into help
2 parents be8325e + 51d038e commit 04fd7f1

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "/dev: Fix missing Amazon Q feature dev auto build setting."
4+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevController.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,8 @@ class FeatureDevController(
544544
}
545545

546546
private suspend fun handleDevCommandUserSetting(tabId: String, value: Boolean) {
547-
CodeWhispererSettings.getInstance().toggleAutoBuildFeature(context.project.basePath, value)
547+
val session = getSessionInfo(tabId)
548+
CodeWhispererSettings.getInstance().toggleAutoBuildFeature(session.context.workspaceRoot.path, value)
548549
messenger.sendAnswer(
549550
tabId = tabId,
550551
message = message("amazonqFeatureDev.chat_message.setting_updated"),

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/customization/CodeWhispererModelConfigurator.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ class DefaultCodeWhispererModelConfigurator : CodeWhispererModelConfigurator, Pe
9090
QRegionProfileSelectedListener.TOPIC,
9191
object : QRegionProfileSelectedListener {
9292
override fun onProfileSelected(project: Project, profile: QRegionProfile?) {
93-
pluginAwareExecuteOnPooledThread {
94-
CodeWhispererModelConfigurator.getInstance().listCustomizations(project, passive = true)
95-
}
93+
switchCustomization(project, null)
9694
}
9795
}
9896
)

plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/CodeWhispererModelConfiguratorTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ class CodeWhispererModelConfiguratorTest {
615615
}
616616

617617
@Test
618-
fun `profile switch should keep using existing customization if new list still contains that arn`() {
618+
fun `should switch to default customization on profile changed`() {
619619
val ssoConn = spy(LegacyManagedBearerSsoConnection(region = "us-east-1", startUrl = "url 1", scopes = Q_SCOPES))
620620
ToolkitConnectionManager.getInstance(projectRule.project).switchConnection(ssoConn)
621621
val oldCustomization = CodeWhispererCustomization("oldArn", "oldName", "oldDescription")
@@ -632,7 +632,7 @@ class CodeWhispererModelConfiguratorTest {
632632
.syncPublisher(QRegionProfileSelectedListener.TOPIC)
633633
.onProfileSelected(projectRule.project, null)
634634

635-
assertThat(sut.activeCustomization(projectRule.project)).isEqualTo(oldCustomization)
635+
assertThat(sut.activeCustomization(projectRule.project)).isEqualTo(null)
636636
}
637637

638638
@Test

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ import software.aws.toolkits.jetbrains.core.saveFileFromUrl
1919
import software.aws.toolkits.jetbrains.services.amazonq.project.manifest.ManifestManager
2020
import software.aws.toolkits.resources.AwsCoreBundle
2121
import java.nio.file.Path
22+
import java.nio.file.Paths
2223
import java.util.concurrent.atomic.AtomicInteger
2324

2425
class ArtifactHelper(private val lspArtifactsPath: Path = DEFAULT_ARTIFACT_PATH, private val maxDownloadAttempts: Int = MAX_DOWNLOAD_ATTEMPTS) {
2526

2627
companion object {
27-
private val DEFAULT_ARTIFACT_PATH = getToolkitsCommonCacheRoot().resolve("aws").resolve("toolkits").resolve("language-servers")
28+
private val DEFAULT_ARTIFACT_PATH = getToolkitsCommonCacheRoot().resolve(Paths.get("aws", "toolkits", "language-servers", "AmazonQ"))
2829
private val logger = getLogger<ArtifactHelper>()
2930
private const val MAX_DOWNLOAD_ATTEMPTS = 3
3031
}

0 commit comments

Comments
 (0)