Skip to content

Commit 43c1c65

Browse files
authored
Merge pull request #5681 from aws/autoMerge/feature/q-lsp-chat
Merge main into feature/q-lsp-chat
2 parents 5af8d6c + 723eb37 commit 43c1c65

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
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
@@ -540,7 +540,8 @@ class FeatureDevController(
540540
}
541541

542542
private suspend fun handleDevCommandUserSetting(tabId: String, value: Boolean) {
543-
CodeWhispererSettings.getInstance().toggleAutoBuildFeature(context.project.basePath, value)
543+
val session = getSessionInfo(tabId)
544+
CodeWhispererSettings.getInstance().toggleAutoBuildFeature(session.context.workspaceRoot.path, value)
544545
messenger.sendAnswer(
545546
tabId = tabId,
546547
message = message("amazonqFeatureDev.chat_message.setting_updated"),

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
@@ -617,7 +617,7 @@ class CodeWhispererModelConfiguratorTest {
617617

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

637-
assertThat(sut.activeCustomization(projectRule.project)).isEqualTo(oldCustomization)
637+
assertThat(sut.activeCustomization(projectRule.project)).isEqualTo(null)
638638
}
639639

640640
@Ignore

plugins/amazonq/shared/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
)

0 commit comments

Comments
 (0)