33
44package software.aws.toolkits.jetbrains.settings
55
6+ import com.intellij.openapi.components.BaseState
67import com.intellij.openapi.components.PersistentStateComponent
78import com.intellij.openapi.components.RoamingType
89import com.intellij.openapi.components.Service
910import com.intellij.openapi.components.State
1011import com.intellij.openapi.components.Storage
1112import 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