Skip to content

Commit 1259950

Browse files
Merge main into feature/dev-execution
2 parents 6511d0c + 21f8b40 commit 1259950

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

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

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 `should switch to default customization on profile changed`() {
618+
fun `profile switch should keep using existing customization if new list still contains that arn`() {
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(null)
635+
assertThat(sut.activeCustomization(projectRule.project)).isEqualTo(oldCustomization)
636636
}
637637

638638
@Test

0 commit comments

Comments
 (0)