IJP-1058 vcs: move LST settings to VCS configurable
authorAleksey Pivovarov <AMPivovarov@gmail.com>
Thu, 2 Sep 2021 17:05:26 +0000 (20:05 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Thu, 2 Sep 2021 17:31:31 +0000 (17:31 +0000)
GitOrigin-RevId: 4741685567ded2eb2e2a3fd416c76e3adc69ec62

platform/vcs-impl/resources/META-INF/VcsExtensionPoints.xml
platform/vcs-impl/resources/META-INF/VcsExtensions.xml
platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsGeneralSettingsConfigurable.kt

index 015d74d796bc979a29a464b26a893ced2062185d..edddd6acc61e6e2d6874a3b4a7e793e527fe885c 100644 (file)
                     interface="com.intellij.openapi.vcs.VcsConfigurableProvider"
                     dynamic="true"/>
 
+    <extensionPoint name="generalVcsSettingsExtension"
+                    beanClass="com.intellij.openapi.vcs.configurable.GeneralVcSettingsProviderEP"
+                    area="IDEA_PROJECT" dynamic="true">
+      <with attribute="instance" implements="com.intellij.openapi.options.UnnamedConfigurable"/>
+    </extensionPoint>
+
     <!--<extensionPoint name="writingAccessProvider"-->
     <!--interface="com.intellij.openapi.vfs.WritingAccessProvider"-->
     <!--area="IDEA_PROJECT"/>-->
index c4a5826fe073565b27b3b439756a899a644b46a8..7f7521dbe34196a6e071f4f5fc6edbaaf0d7b36c 100644 (file)
 
     <searchScopesProvider implementation="com.intellij.vcs.changes.ChangeListsSearchScopeProvider"/>
 
-    <generalEditorOptionsExtension instance="com.intellij.options.VcsGeneralEditorOptionsExtension" />
+    <generalVcsSettingsExtension instance="com.intellij.options.VcsGeneralEditorOptionsExtension" />
 
     <modelScopeItemPresenter implementation="com.intellij.analysis.VcsScopeItemPresenter" id="vcs_scope" order="after module_scope" />
 
index bacd189f0859d250f17be94c4d4b04f3fb6bc5cc..12f1d7256e66525ab09043eaa969bf2748a5a7b6 100644 (file)
@@ -5,9 +5,12 @@ import com.intellij.application.options.editor.checkBox
 import com.intellij.ide.actions.RevealFileAction
 import com.intellij.openapi.application.ApplicationNamesInfo
 import com.intellij.openapi.application.runInEdt
-import com.intellij.openapi.options.BoundSearchableConfigurable
+import com.intellij.openapi.extensions.ExtensionPointName
+import com.intellij.openapi.options.BoundCompositeConfigurable
 import com.intellij.openapi.options.Configurable
 import com.intellij.openapi.options.Configurable.NoScroll
+import com.intellij.openapi.options.ConfigurableEP
+import com.intellij.openapi.options.UnnamedConfigurable
 import com.intellij.openapi.project.Project
 import com.intellij.openapi.ui.ComboBox
 import com.intellij.openapi.ui.DialogPanel
@@ -27,10 +30,19 @@ import com.intellij.vcsUtil.VcsUtil
 import org.jetbrains.annotations.Nls
 import javax.swing.JComponent
 
-class VcsGeneralSettingsConfigurable(val project: Project)
-  : BoundSearchableConfigurable(message("configurable.VcsGeneralConfigurationConfigurable.display.name"),
-                                "project.propVCSSupport.Confirmation"), NoScroll, Configurable.WithEpDependencies {
-  override fun getDependencies() = listOf(VcsEP.EP_NAME)
+internal class GeneralVcSettingsProviderEP(project: Project) : ConfigurableEP<UnnamedConfigurable>(project)
+
+private val VCS_SETTINGS_EP_NAME = ExtensionPointName<GeneralVcSettingsProviderEP>("com.intellij.generalVcsSettingsExtension")
+
+class VcsGeneralSettingsConfigurable(val project: Project) : BoundCompositeConfigurable<UnnamedConfigurable>(
+  message("configurable.VcsGeneralConfigurationConfigurable.display.name"),
+  "project.propVCSSupport.Confirmation"
+), NoScroll, Configurable.WithEpDependencies {
+
+  override fun createConfigurables(): List<UnnamedConfigurable> =
+    VCS_SETTINGS_EP_NAME.getExtensions(project).mapNotNull { it.createConfigurable() }
+
+  override fun getDependencies() = listOf(VcsEP.EP_NAME, VCS_SETTINGS_EP_NAME)
 
   override fun createPanel(): DialogPanel {
     val vcsManager = ProjectLevelVcsManagerEx.getInstanceEx(project)
@@ -155,6 +167,10 @@ class VcsGeneralSettingsConfigurable(val project: Project)
           label(message("settings.checkbox.rows"))
         }
       }
+
+      for (configurable in configurables) {
+        appendDslConfigurableRow(configurable)
+      }
     }
   }