Skip to content

Commit 22431f0

Browse files
authored
Merge pull request #5699 from aws/autoMerge/feature/q-lsp-chat
Merge main into feature/q-lsp-chat
2 parents 20f1abc + edaefb3 commit 22431f0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

640640
@Ignore

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

0 commit comments

Comments
 (0)