Skip to content

Commit 8006ae4

Browse files
Fix(AmazonQ): CodeWhisperer settings persist across restarts (#5283)
The intValue and StringValue used by the state class were missing the @get:Property tag that the value property had, which meant they were not being properly serialized in the xml file. Adding the annotation tag to the other properties allows for serialization of these values on IDE exit.
1 parent 9615647 commit 8006ae4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
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" : "Fixed an issue where Amazon Q settings did not persist across IDE restarts"
4+
}

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/CodeWhispererSettings.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ package software.aws.toolkits.jetbrains.settings
55

66
import com.intellij.openapi.components.BaseState
77
import com.intellij.openapi.components.PersistentStateComponent
8-
import com.intellij.openapi.components.RoamingType
98
import com.intellij.openapi.components.Service
109
import com.intellij.openapi.components.State
1110
import com.intellij.openapi.components.Storage
1211
import com.intellij.openapi.components.service
1312
import com.intellij.util.xmlb.annotations.Property
1413

1514
@Service
16-
@State(name = "codewhispererSettings", storages = [Storage("aws.xml", roamingType = RoamingType.DISABLED)])
15+
@State(name = "codewhispererSettings", storages = [Storage("aws.xml")])
1716
class CodeWhispererSettings : PersistentStateComponent<CodeWhispererConfiguration> {
1817
private val state = CodeWhispererConfiguration()
1918

@@ -119,7 +118,11 @@ class CodeWhispererSettings : PersistentStateComponent<CodeWhispererConfiguratio
119118
class CodeWhispererConfiguration : BaseState() {
120119
@get:Property
121120
val value by map<CodeWhispererConfigurationType, Boolean>()
121+
122+
@get:Property
122123
val intValue by map<CodeWhispererIntConfigurationType, Int>()
124+
125+
@get:Property
123126
val stringValue by map<CodeWhispererStringConfigurationType, String>()
124127
}
125128

0 commit comments

Comments
 (0)