Convert PyWelcomeSettings into a light service to simplify its registration in other...
authorVladimir Lagunov <vladimir.lagunov@jetbrains.com>
Mon, 10 Aug 2020 13:59:03 +0000 (20:59 +0700)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Mon, 10 Aug 2020 14:21:08 +0000 (14:21 +0000)
GitOrigin-RevId: d1a63c438ed1285411ed9afb1823cdf7d00a7440

python/ide/impl/resources/META-INF/pycharm-community-customization.xml
python/ide/impl/src/com/jetbrains/python/newProject/welcome/PyWelcomeSettings.kt

index bd03f16af462239af4953e71971a6b7156d16f2f..fbe3970732e0d7694e1688d40754dbc9289b3b6a 100644 (file)
@@ -68,8 +68,6 @@
                 factoryClass="com.jetbrains.python.console.PythonConsoleToolWindowFactory" secondary="false"/>
 
     <directoryIndexExcludePolicy implementation="com.jetbrains.python.PyDirectoryIndexExcludePolicy"/>
-
-    <applicationService serviceImplementation="com.jetbrains.python.newProject.welcome.PyWelcomeSettings"/>
     <statistics.counterUsagesCollector implementationClass="com.jetbrains.python.newProject.welcome.PyWelcomeCollector"/>
   </extensions>
 
index c434a07f0fe03363f7bb1022bc02b5ac4eed1ed8..99f3f16a1090f14b8031d55b34b4e384a6a50ee9 100644 (file)
@@ -1,12 +1,10 @@
 // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package com.jetbrains.python.newProject.welcome
 
-import com.intellij.openapi.components.PersistentStateComponent
-import com.intellij.openapi.components.ServiceManager
-import com.intellij.openapi.components.State
-import com.intellij.openapi.components.Storage
+import com.intellij.openapi.components.*
 import com.intellij.util.xmlb.XmlSerializerUtil
 
+@Service
 @State(name = "PyWelcomeSettings", storages = [Storage("pyWelcome.xml")], reportStatistic = true)
 class PyWelcomeSettings : PersistentStateComponent<PyWelcomeSettings.State> {
   companion object {