mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 15:06:56 +07:00
PY-64586: Fix NotebooksMigration242: Remove restriction on IU, add R plugin migration
GitOrigin-RevId: 9f2c2d8637b4de91d0792ca8fb4514b13a1dc32d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dd4705d51f
commit
805e96b99c
@@ -1,25 +1,31 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.application.migrations
|
||||
|
||||
import com.intellij.ide.plugins.PluginManagerCore
|
||||
|
||||
private const val JUPYTER_PLUGIN_ID = "intellij.jupyter"
|
||||
private const val JUPYTER_PY_PLUGIN_ID = "intellij.jupyter.py"
|
||||
|
||||
private const val KOTLIN_NOTEBOOKS_PLUGIN_ID = "org.jetbrains.plugins.kotlin.jupyter"
|
||||
private const val R_PLUGIN_ID = "R4Intellij"
|
||||
private const val NOTEBOOKS_CORE_PLUGIN_ID = "com.intellij.notebooks.core"
|
||||
|
||||
internal class NotebooksMigration242 : PluginMigration() {
|
||||
override fun migratePlugins(descriptor: PluginMigrationDescriptor) {
|
||||
if (PluginManagerCore.buildNumber.productCode == "IU") {
|
||||
if (descriptor.currentPluginsToMigrate.contains(JUPYTER_PY_PLUGIN_ID)) {
|
||||
descriptor.removePlugin(JUPYTER_PY_PLUGIN_ID)
|
||||
descriptor.removePluginToDownload(JUPYTER_PY_PLUGIN_ID)
|
||||
}
|
||||
if (descriptor.currentPluginsToMigrate.contains(JUPYTER_PY_PLUGIN_ID)) {
|
||||
descriptor.removePlugin(JUPYTER_PY_PLUGIN_ID)
|
||||
descriptor.removePluginToDownload(JUPYTER_PY_PLUGIN_ID)
|
||||
}
|
||||
|
||||
if (descriptor.currentPluginsToMigrate.contains(KOTLIN_NOTEBOOKS_PLUGIN_ID)
|
||||
|| descriptor.currentPluginsToDownload.contains(KOTLIN_NOTEBOOKS_PLUGIN_ID)) {
|
||||
descriptor.addPluginIfNeeded(NOTEBOOKS_CORE_PLUGIN_ID)
|
||||
}
|
||||
val pluginsThatNeedNotebooksCore = listOf(
|
||||
KOTLIN_NOTEBOOKS_PLUGIN_ID,
|
||||
JUPYTER_PLUGIN_ID,
|
||||
R_PLUGIN_ID,
|
||||
)
|
||||
|
||||
if (pluginsThatNeedNotebooksCore.any { pluginId ->
|
||||
descriptor.currentPluginsToMigrate.contains(pluginId)
|
||||
|| descriptor.currentPluginsToDownload.contains(pluginId)
|
||||
}) {
|
||||
descriptor.addPluginIfNeeded(NOTEBOOKS_CORE_PLUGIN_ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user