From f4910b40465637f862cbedde9973f187569415b0 Mon Sep 17 00:00:00 2001 From: Nikolay Chashnikov Date: Thu, 30 Jan 2025 09:30:51 +0100 Subject: [PATCH] [yaml] properly split YAML plugin and its frontend variant by modules (IJPL-176102) All code from the YAML and 'YAML Extension for Remote Client' plugins is moved to content modules. This is needed to avoid duplication in plugin.xml files, enable automatic layout, and to allow merging these plugins to a single one. 'intellij.yaml' is registered as an embedded content module, so it uses the main plugin classloader, and now has a dependency on 'intellij.yaml.editing' module. This ensures that classes from both modules are available to content modules from other plugins which declare dependency on YAML plugin as before. GitOrigin-RevId: c6d2a156d2ff60aca78925e2e3ef7b96f6593e5a --- .../build/CommunityRepositoryModules.kt | 3 - .../resources/intellij.yaml.editing.xml | 41 +++- ...CodeStyleSettingsCustomDataSynchronizer.kt | 3 + plugins/yaml/intellij.yaml.iml | 1 + plugins/yaml/plugin-content.yaml | 6 +- plugins/yaml/resources/META-INF/plugin.xml | 177 +----------------- plugins/yaml/resources/intellij.yaml.xml | 145 ++++++++++++++ 7 files changed, 196 insertions(+), 180 deletions(-) create mode 100644 plugins/yaml/resources/intellij.yaml.xml diff --git a/platform/build-scripts/src/org/jetbrains/intellij/build/CommunityRepositoryModules.kt b/platform/build-scripts/src/org/jetbrains/intellij/build/CommunityRepositoryModules.kt index 70733021c803..b6605f34dbb8 100644 --- a/platform/build-scripts/src/org/jetbrains/intellij/build/CommunityRepositoryModules.kt +++ b/platform/build-scripts/src/org/jetbrains/intellij/build/CommunityRepositoryModules.kt @@ -29,9 +29,6 @@ object CommunityRepositoryModules { pluginAuto("intellij.json") { spec -> spec.withModule("intellij.json.split", "json-split.jar") }, - pluginAuto("intellij.yaml") { spec -> - spec.withModule("intellij.yaml.editing", "yaml-editing.jar") - }, plugin("intellij.ant") { spec -> spec.mainJarName = "antIntegration.jar" spec.withModule("intellij.ant.jps", "ant-jps.jar") diff --git a/plugins/yaml/editing/resources/intellij.yaml.editing.xml b/plugins/yaml/editing/resources/intellij.yaml.editing.xml index 23d7527251db..9d973483145f 100644 --- a/plugins/yaml/editing/resources/intellij.yaml.editing.xml +++ b/plugins/yaml/editing/resources/intellij.yaml.editing.xml @@ -1 +1,40 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/yaml/editing/src/org/jetbrains/yaml/editing/YamlCodeStyleSettingsCustomDataSynchronizer.kt b/plugins/yaml/editing/src/org/jetbrains/yaml/editing/YamlCodeStyleSettingsCustomDataSynchronizer.kt index 455d324846c1..d00fda293747 100644 --- a/plugins/yaml/editing/src/org/jetbrains/yaml/editing/YamlCodeStyleSettingsCustomDataSynchronizer.kt +++ b/plugins/yaml/editing/src/org/jetbrains/yaml/editing/YamlCodeStyleSettingsCustomDataSynchronizer.kt @@ -1,10 +1,13 @@ // Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.yaml.editing +import com.intellij.openapi.extensions.InternalIgnoreDependencyViolation import com.intellij.psi.codeStyle.CodeStyleSettingsCustomDataSynchronizer import org.jetbrains.yaml.YAMLLanguage import org.jetbrains.yaml.formatter.YAMLCodeStyleSettings +//todo split on two separate classes for the backend and the frontend +@InternalIgnoreDependencyViolation class YamlCodeStyleSettingsCustomDataSynchronizer : CodeStyleSettingsCustomDataSynchronizer() { override val language: YAMLLanguage get() = YAMLLanguage.INSTANCE diff --git a/plugins/yaml/intellij.yaml.iml b/plugins/yaml/intellij.yaml.iml index df94f5742cc7..17246ec1acf6 100644 --- a/plugins/yaml/intellij.yaml.iml +++ b/plugins/yaml/intellij.yaml.iml @@ -10,6 +10,7 @@ + diff --git a/plugins/yaml/plugin-content.yaml b/plugins/yaml/plugin-content.yaml index f3a6aef4e1d6..0f84198ee3ea 100644 --- a/plugins/yaml/plugin-content.yaml +++ b/plugins/yaml/plugin-content.yaml @@ -1,9 +1,9 @@ - name: lib/frontend-split/yaml-frontend.jar modules: - name: intellij.yaml.frontend -- name: lib/yaml-editing.jar - modules: +- name: lib/modules/intellij.yaml.editing.jar + contentModules: - name: intellij.yaml.editing - name: lib/yaml.jar - modules: + contentModules: - name: intellij.yaml \ No newline at end of file diff --git a/plugins/yaml/resources/META-INF/plugin.xml b/plugins/yaml/resources/META-INF/plugin.xml index 0ca5503cbde7..577d0fc3b026 100644 --- a/plugins/yaml/resources/META-INF/plugin.xml +++ b/plugins/yaml/resources/META-INF/plugin.xml @@ -11,177 +11,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - yaml - org.jetbrains.yaml.intentions.YAMLAddOptionalPropertiesIntention - messages.YAMLBundle - yaml.intention.category.name - - - yaml - org.jetbrains.yaml.refactoring.inlineExpandConversion.YAMLExpandCollectionIntentionAction - messages.YAMLBundle - yaml.intention.category.name - - - yaml - org.jetbrains.yaml.refactoring.inlineExpandConversion.YAMLExpandAllCollectionsInsideIntentionAction - messages.YAMLBundle - yaml.intention.category.name - - - yaml - org.jetbrains.yaml.refactoring.inlineExpandConversion.YAMLInlineCollectionIntentionAction - messages.YAMLBundle - yaml.intention.category.name - - - - - - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/plugins/yaml/resources/intellij.yaml.xml b/plugins/yaml/resources/intellij.yaml.xml new file mode 100644 index 000000000000..664b9b20bd03 --- /dev/null +++ b/plugins/yaml/resources/intellij.yaml.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + yaml + org.jetbrains.yaml.intentions.YAMLAddOptionalPropertiesIntention + messages.YAMLBundle + yaml.intention.category.name + + + yaml + org.jetbrains.yaml.refactoring.inlineExpandConversion.YAMLExpandCollectionIntentionAction + messages.YAMLBundle + yaml.intention.category.name + + + yaml + org.jetbrains.yaml.refactoring.inlineExpandConversion.YAMLExpandAllCollectionsInsideIntentionAction + messages.YAMLBundle + yaml.intention.category.name + + + yaml + org.jetbrains.yaml.refactoring.inlineExpandConversion.YAMLInlineCollectionIntentionAction + messages.YAMLBundle + yaml.intention.category.name + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file