From c672589e5eedb6764211805d40d31c6abdfb2e80 Mon Sep 17 00:00:00 2001 From: "alexey.afanasiev" Date: Thu, 6 Jun 2024 00:54:55 +0200 Subject: [PATCH] QD-9246 Remove "Qodana" prefix, use "qodana.application" to define if Qodana is in headless run GitOrigin-RevId: f56172ce17b5c3581df1249876d722716d57da46 --- .../bootstrap/ModuleBasedProductLoadingStrategy.kt | 8 +------- .../openapi/application/ApplicationNamesInfo.java | 2 +- .../core-api/src/com/intellij/util/PlatformUtils.java | 1 - .../com/intellij/ide/plugins/PluginDescriptorLoader.kt | 8 +------- .../src/com/intellij/ide/plugins/PluginLoadingResult.kt | 2 +- 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/platform/bootstrap/src/com/intellij/platform/bootstrap/ModuleBasedProductLoadingStrategy.kt b/platform/bootstrap/src/com/intellij/platform/bootstrap/ModuleBasedProductLoadingStrategy.kt index 59de81b78949..d782e28065d3 100644 --- a/platform/bootstrap/src/com/intellij/platform/bootstrap/ModuleBasedProductLoadingStrategy.kt +++ b/platform/bootstrap/src/com/intellij/platform/bootstrap/ModuleBasedProductLoadingStrategy.kt @@ -77,13 +77,7 @@ internal class ModuleBasedProductLoadingStrategy(internal val moduleRepository: zipFilePool: ZipFilePool, mainClassLoader: ClassLoader, ): List> { - val platformPrefixProperty = PlatformUtils.getPlatformPrefix() - val platformPrefix = if (platformPrefixProperty == PlatformUtils.QODANA_PREFIX) { - System.getProperty("idea.parent.prefix", PlatformUtils.IDEA_PREFIX) - } - else { - platformPrefixProperty - } + val platformPrefix = PlatformUtils.getPlatformPrefix() val result = java.util.ArrayList>() val isInDevServerMode = AppMode.isDevServer() diff --git a/platform/core-api/src/com/intellij/openapi/application/ApplicationNamesInfo.java b/platform/core-api/src/com/intellij/openapi/application/ApplicationNamesInfo.java index 3b8657fc90aa..72bb064d9e25 100644 --- a/platform/core-api/src/com/intellij/openapi/application/ApplicationNamesInfo.java +++ b/platform/core-api/src/com/intellij/openapi/application/ApplicationNamesInfo.java @@ -54,7 +54,7 @@ public final class ApplicationNamesInfo { } else { // Gateway started from another IntelliJ-based IDE; same for Qodana - if (prefix.equals(PlatformUtils.GATEWAY_PREFIX) || prefix.equals(PlatformUtils.QODANA_PREFIX)) { + if (prefix.equals(PlatformUtils.GATEWAY_PREFIX) || "true".equals(System.getProperty("qodana.application"))) { String customAppInfo = System.getProperty("idea.application.info.value"); if (customAppInfo != null) { try { diff --git a/platform/core-api/src/com/intellij/util/PlatformUtils.java b/platform/core-api/src/com/intellij/util/PlatformUtils.java index 7c46693e0503..799ae4b85c26 100644 --- a/platform/core-api/src/com/intellij/util/PlatformUtils.java +++ b/platform/core-api/src/com/intellij/util/PlatformUtils.java @@ -60,7 +60,6 @@ public final class PlatformUtils { public static final String CWM_GUEST_PREFIX = "CodeWithMeGuest"; public static final String JETBRAINS_CLIENT_PREFIX = "JetBrainsClient"; public static final String GATEWAY_PREFIX = "Gateway"; - public static final String QODANA_PREFIX = "Qodana"; @SuppressWarnings("SSBasedInspection") private static final Set COMMERCIAL_EDITIONS = new HashSet<>(Arrays.asList( IDEA_PREFIX, APPCODE_PREFIX, CLION_PREFIX, MOBILE_IDE_PREFIX, PYCHARM_PREFIX, DATASPELL_PREFIX, RUBY_PREFIX, PHP_PREFIX, WEB_PREFIX, diff --git a/platform/core-impl/src/com/intellij/ide/plugins/PluginDescriptorLoader.kt b/platform/core-impl/src/com/intellij/ide/plugins/PluginDescriptorLoader.kt index 46ef08c1cba0..5a2850fefaa3 100644 --- a/platform/core-impl/src/com/intellij/ide/plugins/PluginDescriptorLoader.kt +++ b/platform/core-impl/src/com/intellij/ide/plugins/PluginDescriptorLoader.kt @@ -550,13 +550,7 @@ internal fun CoroutineScope.loadPluginDescriptorsImpl( customPluginDir: Path, bundledPluginDir: Path?, ): List> { - val platformPrefixProperty = PlatformUtils.getPlatformPrefix() - val platformPrefix = if (platformPrefixProperty == PlatformUtils.QODANA_PREFIX) { - System.getProperty("idea.parent.prefix", PlatformUtils.IDEA_PREFIX) - } - else { - platformPrefixProperty - } + val platformPrefix = PlatformUtils.getPlatformPrefix() val result = ArrayList>() if (isUnitTestMode) { diff --git a/platform/core-impl/src/com/intellij/ide/plugins/PluginLoadingResult.kt b/platform/core-impl/src/com/intellij/ide/plugins/PluginLoadingResult.kt index 343e22abb3d0..35714692352b 100644 --- a/platform/core-impl/src/com/intellij/ide/plugins/PluginLoadingResult.kt +++ b/platform/core-impl/src/com/intellij/ide/plugins/PluginLoadingResult.kt @@ -15,7 +15,7 @@ import org.jetbrains.annotations.VisibleForTesting // If a plugin does not include any module dependency tags in its plugin.xml, // it's assumed to be a legacy plugin and is loaded only in IntelliJ IDEA. @ApiStatus.Internal -class PluginLoadingResult(private val checkModuleDependencies: Boolean = !PlatformUtils.isIntelliJ() && PlatformUtils.getPlatformPrefix() != PlatformUtils.QODANA_PREFIX) { +class PluginLoadingResult(private val checkModuleDependencies: Boolean = !PlatformUtils.isIntelliJ()) { private val incompletePlugins = HashMap() @JvmField