File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
src/main/kotlin/io/runescript/plugin/ide/neptune Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -4,27 +4,28 @@ import com.intellij.openapi.components.*
4
4
import com.intellij.openapi.module.Module
5
5
import com.intellij.openapi.module.ModuleUtil
6
6
import com.intellij.psi.PsiElement
7
- import com.intellij.util.xmlb.XmlSerializerUtil
8
7
9
8
@State(
10
9
name = " NeptuneModuleData" ,
11
10
storages = [Storage (StoragePathMacros .MODULE_FILE )]
12
11
)
13
- class NeptuneModuleData : PersistentStateComponent <NeptuneModuleData > {
12
+ class NeptuneModuleData : SerializablePersistentStateComponent <NeptuneModuleData . State >( State ()) {
14
13
15
- override fun getState () = this
14
+ data class State (
15
+ var dummy : Int = 0
16
+ )
16
17
17
- override fun loadState (state : NeptuneModuleData ) {
18
- XmlSerializerUtil .copyBean(state, this )
19
- }
20
-
21
- fun updateFromImportData (@Suppress(" unused" ) importData : NeptuneProjectImportData ) {
18
+ val dummy: Int
19
+ get() = state.dummy
22
20
21
+ fun updateFromImportData (importData : NeptuneProjectImportData ) = updateState {
22
+ it.dummy = 0
23
+ it
23
24
}
24
25
}
25
26
26
- val Module .neptuneModuleData: NeptuneModuleData ?
27
+ val Module .neptuneModuleData: NeptuneModuleData
27
28
get() = service<NeptuneModuleData >()
28
29
29
30
val PsiElement .neptuneModuleData: NeptuneModuleData ?
30
- get() = ModuleUtil .findModuleForFile(containingFile)?.neptuneModuleData
31
+ get() = ModuleUtil .findModuleForFile(containingFile)?.neptuneModuleData
You can’t perform that action at this time.
0 commit comments