mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[pycharm] PY-79803 Debugger: disable the button in case of jupyter frame accessor
GitOrigin-RevId: f092bc6669686617ff4ed73fa0592344aab8e222
This commit is contained in:
committed by
intellij-monorepo-bot
parent
89c85d2010
commit
bc76c42ae6
@@ -498,7 +498,8 @@ public class PyDebugValue extends XNamedValue {
|
||||
}
|
||||
|
||||
private static void addViewAsImageLink(XValueNodeImpl valueNode) {
|
||||
if (!checkAndShowViewAsImageOnScreen((PyDebugValue)valueNode.getXValue()))
|
||||
PyDebugValue debugValue = (PyDebugValue)valueNode.getXValue();
|
||||
if (!checkAndShowViewAsImageOnScreen(debugValue) || hasJupyterFrameAccessor(debugValue.getFrameAccessor()))
|
||||
return;
|
||||
String viewAsImageText = PydevBundle.message("pydev.view.as.image");
|
||||
valueNode.addAdditionalHyperlink(new XDebuggerTreeNodeHyperlink(viewAsImageText) {
|
||||
@@ -522,6 +523,12 @@ public class PyDebugValue extends XNamedValue {
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: remove this check after dealing with IOPub
|
||||
private static boolean hasJupyterFrameAccessor(PyFrameAccessor frameAccessor) {
|
||||
if (frameAccessor == null) return true;
|
||||
return frameAccessor.getClass().getName().contains("JupyterVarsFrameAccessor");
|
||||
}
|
||||
|
||||
private static boolean checkAndShowViewAsImageOnScreen(PyDebugValue debugValue) {
|
||||
boolean showViewAsImage = Registry.get("actions.show.as.image.visibility").asBoolean();
|
||||
if (!showViewAsImage) {
|
||||
|
||||
Reference in New Issue
Block a user