mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use array Evaluation Expression (now works for dicts, tuples, etc. PY-14421)
This commit is contained in:
@@ -387,7 +387,7 @@ class BaseInterpreterInterface:
|
||||
|
||||
def getArray(self, attr, roffset, coffset, rows, cols, format):
|
||||
xml = "<xml>"
|
||||
name = ".".join(attr.split("\t"))
|
||||
name = attr.split("\t")[-1]
|
||||
array = pydevd_vars.evalInContext(name, self.getNamespace(), self.getNamespace())
|
||||
|
||||
if rows == -1 and cols == -1:
|
||||
|
||||
@@ -974,15 +974,15 @@ class InternalGetArray(InternalThreadCommand):
|
||||
self.thread_id = thread_id
|
||||
self.frame_id = frame_id
|
||||
self.scope = scope
|
||||
self.name = ".".join(attrs.split("\t"))
|
||||
self.name = attrs.split("\t")[-1]
|
||||
self.attrs = attrs
|
||||
self.roffset = int(roffset)
|
||||
self.coffset = int(coffset)
|
||||
self.rows = int(rows)
|
||||
self.cols = int(cols)
|
||||
self.format = format
|
||||
if hasattr(self.format, 'decode'):
|
||||
self.format = self.format.decode('utf-8')
|
||||
if hasattr(self.format, 'encode'):
|
||||
self.format = self.format.encode('utf-8')
|
||||
|
||||
def doIt(self, dbg):
|
||||
try:
|
||||
|
||||
@@ -554,14 +554,7 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl
|
||||
throws PyDebuggerException {
|
||||
if (myClient != null) {
|
||||
try {
|
||||
String fullName = var.getName();
|
||||
PyDebugValue child = var;
|
||||
while (child.getParent() != null) {
|
||||
child = child.getParent();
|
||||
fullName = child.getName() + "\t" + fullName;
|
||||
}
|
||||
|
||||
Object ret = myClient.execute(GET_ARRAY, new Object[]{fullName, rowOffset, colOffset, rows, cols, format});
|
||||
Object ret = myClient.execute(GET_ARRAY, new Object[]{var.getName(), rowOffset, colOffset, rows, cols, format});
|
||||
if (ret instanceof String) {
|
||||
return ProtocolParser.parseArrayValues((String)ret, this);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class AsyncArrayTableModel extends AbstractTableModel {
|
||||
final PyDebugValue value = myProvider.getDebugValue();
|
||||
final PyDebugValue slicedValue =
|
||||
new PyDebugValue(myProvider.getSliceText(), value.getType(), value.getValue(), value.isContainer(), value.isErrorOnEval(),
|
||||
value.getFrameAccessor());
|
||||
value.getParent(), value.getFrameAccessor());
|
||||
|
||||
ListenableFutureTask<ArrayChunk> task = ListenableFutureTask.create(new Callable<ArrayChunk>() {
|
||||
@Override
|
||||
|
||||
@@ -167,7 +167,7 @@ public class NumpyArrayTable {
|
||||
}
|
||||
|
||||
public void init() {
|
||||
init(myValue.getName(), false);
|
||||
init(getDebugValue().getEvaluationExpression(), false);
|
||||
}
|
||||
|
||||
public void init(final String slice, final boolean inPlace) {
|
||||
@@ -181,14 +181,8 @@ public class NumpyArrayTable {
|
||||
public void run() {
|
||||
final PyDebugValue value = getDebugValue();
|
||||
PyDebugValue parent = value.getParent();
|
||||
String sl = slice;
|
||||
|
||||
if (slice.contains(".")) {
|
||||
sl = slice.substring(slice.lastIndexOf(".") + 1);
|
||||
}
|
||||
|
||||
final PyDebugValue slicedValue =
|
||||
new PyDebugValue(sl, value.getType(), value.getValue(), value.isContainer(), value.isErrorOnEval(),
|
||||
new PyDebugValue(slice, value.getType(), value.getValue(), value.isContainer(), value.isErrorOnEval(),
|
||||
parent, value.getFrameAccessor());
|
||||
|
||||
final String format = getFormat().isEmpty() ? "%" : getFormat();
|
||||
@@ -433,14 +427,7 @@ public class NumpyArrayTable {
|
||||
}
|
||||
|
||||
public String getNodeFullName() {
|
||||
String fullName = getDebugValue().getName();
|
||||
PyDebugValue child = getDebugValue();
|
||||
while (child.getParent() != null) {
|
||||
child = child.getParent();
|
||||
fullName = child.getName() + "." + fullName;
|
||||
}
|
||||
|
||||
return fullName;
|
||||
return getDebugValue().getEvaluationExpression();
|
||||
}
|
||||
|
||||
public String getFormat() {
|
||||
|
||||
Reference in New Issue
Block a user