User: joe Date: 12 Nov 26 23:37 Revision: 79abe720325c3d51f9468fb5540352ab7acf004d Summary: Fix internal/deprecated API usages in 2026.3 TeamCity URL: http://ci.mcdev.io:80/viewModification.html?tab=vcsModificationFiles&modId=10736&personal=false Index: src/main/kotlin/creator/custom/CreatorTemplateProcessor.kt =================================================================== --- src/main/kotlin/creator/custom/CreatorTemplateProcessor.kt (revision a15f25bace4fbd992dce023d71421d84d3e43c6e) +++ src/main/kotlin/creator/custom/CreatorTemplateProcessor.kt (revision 79abe720325c3d51f9468fb5540352ab7acf004d) @@ -37,7 +37,7 @@ import com.intellij.openapi.diagnostic.Attachment import com.intellij.openapi.diagnostic.ControlFlowException import com.intellij.openapi.diagnostic.thisLogger -import com.intellij.openapi.fileEditor.FileEditorManager +import com.intellij.openapi.fileEditor.OpenFileDescriptor import com.intellij.openapi.module.ModuleManager import com.intellij.openapi.observable.properties.GraphProperty import com.intellij.openapi.observable.properties.PropertyGraph @@ -387,11 +387,10 @@ project: Project, files: MutableList> ) { - val fileEditorManager = FileEditorManager.getInstance(project) - val projectView = ProjectView.getInstance(project) + val projectView = ProjectView.getInstance(project) for ((desc, file) in files) { if (desc.openInEditor == true) { - fileEditorManager.openFile(file, true) + OpenFileDescriptor(project, file).navigate(true) projectView.select(null, file, false) } } Index: src/main/kotlin/creator/custom/npm/NpmEnvironment.kt =================================================================== --- src/main/kotlin/creator/custom/npm/NpmEnvironment.kt (revision a15f25bace4fbd992dce023d71421d84d3e43c6e) +++ src/main/kotlin/creator/custom/npm/NpmEnvironment.kt (revision 79abe720325c3d51f9468fb5540352ab7acf004d) @@ -101,7 +101,7 @@ } val name = if (SystemInfo.isWindows) "npm.cmd" else "npm" - return PathEnvironmentVariableUtil.findInPath(name)?.absolutePath + return PathEnvironmentVariableUtil.findFirst(name)?.toAbsolutePath()?.toString() } /** @@ -348,7 +348,7 @@ if (sibling.isRegularFile() && sibling.isExecutable()) { return sibling.toString() } - return PathEnvironmentVariableUtil.findInPath(name)?.absolutePath + return PathEnvironmentVariableUtil.findFirst(name)?.toAbsolutePath()?.toString() } /** Index: src/main/kotlin/creator/custom/providers/BuiltinTemplateProvider.kt =================================================================== --- src/main/kotlin/creator/custom/providers/BuiltinTemplateProvider.kt (revision a15f25bace4fbd992dce023d71421d84d3e43c6e) +++ src/main/kotlin/creator/custom/providers/BuiltinTemplateProvider.kt (revision 79abe720325c3d51f9468fb5540352ab7acf004d) @@ -24,10 +24,10 @@ import com.demonwav.mcdev.asset.MCDevBundle import com.demonwav.mcdev.creator.custom.TemplateDescriptor import com.demonwav.mcdev.creator.modalityState -import com.demonwav.mcdev.update.PluginUtil import com.demonwav.mcdev.util.refreshSync import com.demonwav.mcdev.util.virtualFile import com.intellij.ide.util.projectWizard.WizardContext +import com.intellij.openapi.application.PluginPathManager import com.intellij.openapi.observable.properties.PropertyGraph import com.intellij.openapi.progress.ProgressIndicator import com.intellij.ui.dsl.builder.bindSelected @@ -37,7 +37,9 @@ class BuiltinTemplateProvider : RemoteTemplateProvider() { private val builtinRepoUrl = $$"https://github.com/minecraft-dev/templates/archive/refs/heads/v$version.zip" - private val builtinTemplatesPath = PluginUtil.plugin.pluginPath.resolve("lib/resources/builtin-templates") + private val builtinTemplatesPath = + PluginPathManager.getPluginDistPath(BuiltinTemplateProvider::class.java, "lib/resources/builtin-templates") + ?: error("Minecraft Development plugin directory not found") private var repoUpdated: Boolean = false override val label: String = MCDevBundle("template.provider.builtin.label") Index: src/main/kotlin/creator/step/FixedAssetsNewProjectWizardStep.kt =================================================================== --- src/main/kotlin/creator/step/FixedAssetsNewProjectWizardStep.kt (revision a15f25bace4fbd992dce023d71421d84d3e43c6e) +++ src/main/kotlin/creator/step/FixedAssetsNewProjectWizardStep.kt (revision 79abe720325c3d51f9468fb5540352ab7acf004d) @@ -33,7 +33,7 @@ import com.intellij.ide.wizard.runAfterOpened import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.WriteAction -import com.intellij.openapi.fileEditor.FileEditorManager +import com.intellij.openapi.fileEditor.OpenFileDescriptor import com.intellij.openapi.project.Project import com.intellij.openapi.util.io.NioFiles import com.intellij.openapi.vfs.VfsUtil @@ -159,11 +159,10 @@ ReformatCodeProcessor(project, psiFiles.toTypedArray(), null, false).run() - val fileEditorManager = FileEditorManager.getInstance(project) val projectView = ProjectView.getInstance(project) for (file in generatedFiles) { if (file.path in filesToOpen) { - fileEditorManager.openFile(file, true) + OpenFileDescriptor(project, file).navigate(true) projectView.select(null, file, false) } } Index: src/main/kotlin/errorreporter/ErrorReporter.kt =================================================================== --- src/main/kotlin/errorreporter/ErrorReporter.kt (revision a15f25bace4fbd992dce023d71421d84d3e43c6e) +++ src/main/kotlin/errorreporter/ErrorReporter.kt (revision 79abe720325c3d51f9468fb5540352ab7acf004d) @@ -23,7 +23,7 @@ import com.demonwav.mcdev.asset.MCDevBundle import com.demonwav.mcdev.update.PluginUtil import com.intellij.ide.DataManager -import com.intellij.ide.plugins.PluginManagerCore +import com.intellij.ide.plugins.PluginDetailsService import com.intellij.idea.IdeaLogger import com.intellij.notification.NotificationGroupManager import com.intellij.notification.NotificationType @@ -91,9 +91,9 @@ sentryEvent.throwable = event.throwable - PluginManagerCore.getPlugin(PluginUtil.PLUGIN_ID)?.let { plugin -> - val (ideaVersion, coreVersion) = plugin.version.split('-', limit = 2) - sentryEvent.release = plugin.version + PluginDetailsService.getInstance().findDetails(PluginUtil.PLUGIN_ID)?.version?.let { version -> + val (ideaVersion, coreVersion) = version.split('-', limit = 2) + sentryEvent.release = version sentryEvent.setTag("idea_version", ideaVersion) sentryEvent.setTag("core_version", coreVersion) } Index: src/main/kotlin/update/PluginUtil.kt =================================================================== --- src/main/kotlin/update/PluginUtil.kt (revision a15f25bace4fbd992dce023d71421d84d3e43c6e) +++ src/main/kotlin/update/PluginUtil.kt (revision 79abe720325c3d51f9468fb5540352ab7acf004d) @@ -20,21 +20,15 @@ package com.demonwav.mcdev.update -import com.intellij.ide.plugins.IdeaPluginDescriptor -import com.intellij.ide.plugins.PluginManagerCore +import com.intellij.ide.plugins.PluginDetailsService import com.intellij.openapi.extensions.PluginId object PluginUtil { val PLUGIN_ID = PluginId.getId("com.demonwav.minecraft-dev") - val plugin: IdeaPluginDescriptor - get() { - return PluginManagerCore.getPlugin(PLUGIN_ID) - ?: error("Minecraft Development plugin not found: " + PluginManagerCore.plugins.contentToString()) - } - val pluginVersion: String - get() = plugin.version + get() = PluginDetailsService.getInstance().findDetails(PLUGIN_ID)?.version + ?: error("Minecraft Development plugin not found") val useragent: String get() = "github_org/minecraft-dev/$pluginVersion"