From f56b64529be9be3bc90f7b6b161c211480697746 Mon Sep 17 00:00:00 2001 From: "ekaterina.itsenko" Date: Thu, 10 Jul 2025 20:39:38 +0300 Subject: [PATCH] [pycharm] PY-23411 Debugger: remove deprecated function call and remove odd try-catch GitOrigin-RevId: cab5e6d437ddad26c75dd701b102f4cb61780614 --- .../python/debugger/PyDebugValue.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/python/pydevSrc/src/com/jetbrains/python/debugger/PyDebugValue.java b/python/pydevSrc/src/com/jetbrains/python/debugger/PyDebugValue.java index 4c8050263b2c..fc4f415c79f7 100644 --- a/python/pydevSrc/src/com/jetbrains/python/debugger/PyDebugValue.java +++ b/python/pydevSrc/src/com/jetbrains/python/debugger/PyDebugValue.java @@ -7,10 +7,7 @@ import com.google.common.collect.Maps; import com.intellij.icons.AllIcons; import com.intellij.ide.DataManager; import com.intellij.ide.plugins.PluginManagerCore; -import com.intellij.openapi.actionSystem.ActionManager; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.DataContext; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.diagnostic.Logger; @@ -548,12 +545,12 @@ public class PyDebugValue extends XNamedValue { public void onClick(MouseEvent event) { AnAction action = ActionManager.getInstance().getAction("JupyterShowAsImageAction"); DataContext dataContext = DataManager.getInstance().getDataContext((Component)event.getSource()); - AnActionEvent actionEvent = AnActionEvent.createFromAnAction( - action, - null, - "JupyterShowAsImageAction", - dataContext - ); + AnActionEvent actionEvent = AnActionEvent.createEvent(action, + dataContext, + null, + "JupyterShowAsImageAction", + ActionUiKind.NONE, + null); action.actionPerformed(actionEvent); } @@ -565,13 +562,9 @@ public class PyDebugValue extends XNamedValue { } private static boolean checkAndShowViewAsImageOnScreen(PyDebugValue debugValue) { - try { return Registry.is("actions.show.as.image.visibility", false) && !PluginManagerCore.isDisabled(PluginManagerCore.ULTIMATE_PLUGIN_ID) && checkAndEnableViewAsImageVisibility(debugValue); - } catch (MissingResourceException e) { - return false; - } } private static boolean checkAndEnableViewAsImageVisibility(PyDebugValue debugValue) {