File tree Expand file tree Collapse file tree 4 files changed +15
-8
lines changed
kotlin/com/github/ilovegamecoding/intellijcodexp Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 1
1
package com.github.ilovegamecoding.intellijcodexp.core
2
2
3
3
import com.intellij.openapi.components.PersistentStateComponent
4
+ import com.intellij.openapi.components.State
5
+ import com.intellij.openapi.components.Storage
4
6
import com.intellij.util.xmlb.XmlSerializerUtil
5
7
8
+ @State(
9
+ name = " com.github.ilovegamecoding.intellijcodexp.core.CodeXP" ,
10
+ storages = [Storage (" CodeXP.xml" )]
11
+ )
6
12
class CodeXP : PersistentStateComponent <CodeXP > {
7
13
var hasExecuted: Boolean = false
8
14
override fun getState (): CodeXP {
Original file line number Diff line number Diff line change 1
1
package com.github.ilovegamecoding.intellijcodexp.core
2
2
3
3
import com.intellij.openapi.components.PersistentStateComponent
4
+ import com.intellij.openapi.components.State
5
+ import com.intellij.openapi.components.Storage
4
6
import com.intellij.util.xmlb.XmlSerializerUtil
5
7
8
+ @State(
9
+ name = " com.github.ilovegamecoding.intellijcodexp.core.CodeXPUser" ,
10
+ storages = [Storage (" CodeXPUser.xml" )]
11
+ )
6
12
class CodeXPUser : PersistentStateComponent <CodeXPUser > {
7
13
var xp: Long = 0
8
14
var nickname: String = " "
Original file line number Diff line number Diff line change @@ -10,12 +10,9 @@ class CodeXPStartupActivity : StartupActivity {
10
10
override fun runActivity (project : Project ) {
11
11
val state = service<CodeXP >()
12
12
if (! state.hasExecuted) {
13
- thisLogger().info(" CodeXP first execution" )
14
13
// TODO: Add plugin initialize logic
15
14
16
15
state.hasExecuted = true
17
- } else {
18
- thisLogger().info(" CodeXP has already executed" )
19
16
}
20
17
}
21
18
}
Original file line number Diff line number Diff line change 12
12
<toolWindow factoryClass =" com.github.ilovegamecoding.intellijcodexp.toolWindow.CodeXPToolWindowFactory"
13
13
id =" CodeXPToolWindow" />
14
14
<postStartupActivity implementation =" com.github.ilovegamecoding.intellijcodexp.startup.CodeXPStartupActivity" />
15
+ <applicationService serviceImplementation =" com.github.ilovegamecoding.intellijcodexp.core.CodeXP" />
16
+ <applicationService serviceImplementation =" com.github.ilovegamecoding.intellijcodexp.core.CodeXPUser" />
17
+ <applicationService serviceImplementation =" com.github.ilovegamecoding.intellijcodexp.services.CodeXPService" />
15
18
</extensions >
16
19
17
20
<application-components >
18
- <component >
19
- <implementation-class >com.github.ilovegamecoding.intellijcodexp.services.CodeXPService</implementation-class >
20
- <implementation-class >com.github.ilovegamecoding.intellijcodexp.core.CodeXP</implementation-class >
21
- <implementation-class >com.github.ilovegamecoding.intellijcodexp.core.CodeXPUser</implementation-class >
22
- </component >
23
21
</application-components >
24
22
25
23
<applicationListeners >
You can’t perform that action at this time.
0 commit comments