IJPL-157080 add the ability to perform migration from another IDE

GitOrigin-RevId: e77464621f6a205ad1e2f3a5444afb1e1926505d
This commit is contained in:
Vera Petrenkova
2024-06-25 16:17:41 +02:00
committed by intellij-monorepo-bot
parent 72dbe58a49
commit 8f614c8382
3 changed files with 9 additions and 3 deletions

View File

@@ -47,14 +47,14 @@ internal fun enableL10nIfPluginInstalled(previousVersion: String?, oldPluginsDir
* @param descriptor the descriptor of the plugin to be checked
* @return `true` if the plugin is a localization plugin; `false` otherwise
*/
fun isLocalizationPlugin(descriptor: IdeaPluginDescriptor): Boolean {
private fun isLocalizationPlugin(descriptor: IdeaPluginDescriptor): Boolean {
if (descriptor !is IdeaPluginDescriptorImpl) return false
val extensionPoints = descriptor.epNameToExtensions
val epName = "com.intellij.languageBundle"
return extensionPoints.containsKey(epName)
}
fun getLanguageTagFromDescriptor(descriptor: IdeaPluginDescriptor): String? {
private fun getLanguageTagFromDescriptor(descriptor: IdeaPluginDescriptor): String? {
if (descriptor !is IdeaPluginDescriptorImpl) return null
val extensionPoints = descriptor.epNameToExtensions
val epName = "com.intellij.languageBundle"

View File

@@ -453,6 +453,8 @@ class JbImportServiceImpl(private val coroutineScope: CoroutineScope) : JbServic
ImportSettingsEventsCollector.jbPluginsImportTimeSpent(it)
}
}
LOG.info("Started localization migration...")
importer.migrateLocalization()
if (progressIndicator.isCanceled()) {
LOG.info("Import cancelled after importing the plugins. ${if (restartRequired) "Will now restart." else ""}")
return restartRequired

View File

@@ -500,13 +500,17 @@ class JbSettingsImporter(private val configDirPath: Path,
ConfigImportHelper.updateVMOptions(PathManager.getConfigDir(), LOG)
}
CustomConfigMigrationOption.MigrateFromCustomPlace(configDirPath).writeConfigMarkerFile(PathManager.getConfigDir())
ConfigImportHelper.migrateLocalization(configDirPath, pluginsPath)
migrateLocalization()
(System.currentTimeMillis() - startTime).let {
LOG.info("Raw import finished in $it ms.")
ImportSettingsEventsCollector.jbTotalImportTimeSpent(it)
}
}
fun migrateLocalization() {
ConfigImportHelper.migrateLocalization(configDirPath, pluginsPath)
}
internal class ImportStreamProvider(private val configDirPath: Path) : StreamProvider {
override val isExclusive = false