Skip to content

Commit 7df6549

Browse files
committed
Changing to BaseState
1 parent 2d99e46 commit 7df6549

File tree

1 file changed

+7
-11
lines changed
  • plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings

1 file changed

+7
-11
lines changed

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33

44
package software.aws.toolkits.jetbrains.settings
55

6+
import com.intellij.openapi.components.BaseState
67
import com.intellij.openapi.components.PersistentStateComponent
78
import com.intellij.openapi.components.RoamingType
89
import com.intellij.openapi.components.Service
910
import com.intellij.openapi.components.State
1011
import com.intellij.openapi.components.Storage
1112
import com.intellij.openapi.components.service
12-
import com.intellij.util.xmlb.annotations.Attribute
13+
import com.intellij.util.xmlb.annotations.Property
1314

1415
@Service
1516
@State(name = "lspSettings", storages = [Storage("aws.xml", roamingType = RoamingType.DISABLED)])
@@ -22,12 +23,7 @@ class LspSettings : PersistentStateComponent<LspConfiguration> {
2223
this.state = state
2324
}
2425

25-
fun getArtifactPath() = run {
26-
when {
27-
state.artifactPath == null -> ""
28-
else -> state.artifactPath.toString()
29-
}
30-
}
26+
fun getArtifactPath() = state.artifactPath
3127

3228
fun setExecutablePath(artifactPath: String?) {
3329
if (artifactPath == null) {
@@ -42,7 +38,7 @@ class LspSettings : PersistentStateComponent<LspConfiguration> {
4238
}
4339
}
4440

45-
data class LspConfiguration(
46-
@Attribute(value = "path")
47-
var artifactPath: String? = null,
48-
)
41+
class LspConfiguration : BaseState() {
42+
@get:Property
43+
var artifactPath: String = ""
44+
}

0 commit comments

Comments
 (0)