File tree Expand file tree Collapse file tree
src/main/kotlin/com/github/cnrture/quickprojectwizard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ import com.github.cnrture.quickprojectwizard.gradle.getGradleKts
3737import com.github.cnrture.quickprojectwizard.gradle.getProjectGradleKts
3838import com.github.cnrture.quickprojectwizard.toolwindow.data.SettingsService
3939import com.github.cnrture.quickprojectwizard.util.NotificationUtil
40- import com.intellij.openapi.components.ServiceManager.getService
40+ import com.intellij.openapi.application.ApplicationManager
41+ import com.intellij.openapi.components.service
4142import java.io.File
4243
4344fun RecipeExecutor.composeProjectRecipe (
@@ -59,7 +60,7 @@ fun RecipeExecutor.composeProjectRecipe(
5960) {
6061 val packagePath = escapeKotlinIdentifier(packageName)
6162
62- val settings = getService( SettingsService :: class .java )
63+ val settings = ApplicationManager .getApplication().service< SettingsService >( )
6364 settings.loadState(
6465 settings.state.copy(
6566 isHiltEnable = isHiltEnable,
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ import com.github.cnrture.quickprojectwizard.toolwindow.data.SettingsService
2626import com.github.cnrture.quickprojectwizard.util.NotificationUtil
2727import com.github.cnrture.quickprojectwizard.xmlarch.common.emptyCollectExtension
2828import com.github.cnrture.quickprojectwizard.xmlarch.ui.*
29- import com.intellij.openapi.components.ServiceManager.getService
29+ import com.intellij.openapi.application.ApplicationManager
30+ import com.intellij.openapi.components.service
3031import java.io.File
3132
3233fun RecipeExecutor.xmlProjectRecipe (
@@ -48,7 +49,7 @@ fun RecipeExecutor.xmlProjectRecipe(
4849) {
4950 val packagePath = escapeKotlinIdentifier(packageName)
5051
51- val settings = getService( SettingsService :: class .java )
52+ val settings = ApplicationManager .getApplication().service< SettingsService >( )
5253 settings.loadState(
5354 settings.state.copy(
5455 isHiltEnable = isHiltEnable,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import com.intellij.openapi.components.Storage
99 name = " QuickProjectWizardSettings" ,
1010 storages = [Storage (" quickProjectWizard.xml" )]
1111)
12- @Service(Service .Level .PROJECT )
12+ @Service(Service .Level .APP )
1313class SettingsService : PersistentStateComponent <SettingsState > {
1414 private var myState = SettingsState ()
1515
@@ -18,4 +18,4 @@ class SettingsService : PersistentStateComponent<SettingsState> {
1818 override fun loadState (state : SettingsState ) {
1919 myState = state
2020 }
21- }
21+ }
You can’t perform that action at this time.
0 commit comments