mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix expanding collections with long values in debugger (PY-16866)
When we view the value of the long variable, we run Evaluate expression command instead of Get Variable, so we need prepare variables for the Python side.
This commit is contained in:
@@ -133,15 +133,30 @@ public class PyDebugValue extends XNamedValue {
|
||||
return "__len__".equals(name);
|
||||
}
|
||||
|
||||
private static boolean isCollection(@NotNull PyDebugValue parent) {
|
||||
String type = parent.getType();
|
||||
return type.equals("dict") || type.equals("list");
|
||||
}
|
||||
|
||||
private static String getChildNamePresentation(@NotNull PyDebugValue parent, @NotNull String childName) {
|
||||
if (isCollection(parent)) {
|
||||
return "[".concat(removeId(childName)).concat("]");
|
||||
}
|
||||
else {
|
||||
return ".".concat(childName);
|
||||
}
|
||||
}
|
||||
|
||||
private String getFullName() {
|
||||
String result = myName;
|
||||
String result = "";
|
||||
String curNodeName = myName;
|
||||
PyDebugValue parent = myParent;
|
||||
while (parent != null) {
|
||||
result = "." + result;
|
||||
result = parent.getName() + result;
|
||||
result = getChildNamePresentation(parent, curNodeName).concat(result);
|
||||
curNodeName = parent.getName();
|
||||
parent = parent.getParent();
|
||||
}
|
||||
return result;
|
||||
return curNodeName.concat(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user