add new field to param argument passed to open data viewer command (#15652)
This commit is contained in:
Родитель
0b1fe581a0
Коммит
d3dc06fdb1
|
@ -213,6 +213,7 @@ def _VSCODE_getVariable(what_to_get, is_debugging, *args):
|
|||
vartype = _VSCODE_builtins.type(var)
|
||||
if _VSCODE_builtins.hasattr(vartype, "__name__"):
|
||||
result["type"] = typeName = vartype.__name__
|
||||
result["fullType"] = getFullType(vartype)
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
|
@ -264,12 +265,18 @@ def _VSCODE_getVariable(what_to_get, is_debugging, *args):
|
|||
|
||||
def _VSCODE_getVariableTypes(varnames):
|
||||
# Map with key: varname and value: vartype
|
||||
result = {}
|
||||
result = []
|
||||
for name in varnames:
|
||||
try:
|
||||
vartype = _VSCODE_builtins.type(globals()[name])
|
||||
if _VSCODE_builtins.hasattr(vartype, "__name__"):
|
||||
result[name] = vartype.__name__
|
||||
result.append(
|
||||
{
|
||||
"name": name,
|
||||
"type": vartype.__name__,
|
||||
"fullType": getFullType(vartype),
|
||||
}
|
||||
)
|
||||
except _VSCODE_builtins.TypeError:
|
||||
pass
|
||||
if is_debugging:
|
||||
|
|
|
@ -14,6 +14,7 @@ export interface IJupyterVariable {
|
|||
executionCount?: number;
|
||||
supportsDataExplorer: boolean;
|
||||
type: string;
|
||||
fullType?: string;
|
||||
size: number;
|
||||
shape: string;
|
||||
dataDimensionality?: number;
|
||||
|
|
|
@ -116,6 +116,7 @@ export class KernelVariables implements IJupyterVariables {
|
|||
value: undefined,
|
||||
supportsDataExplorer: false,
|
||||
type: matchName.type,
|
||||
fullType: matchName.fullType,
|
||||
size: 0,
|
||||
count: 0,
|
||||
shape: '',
|
||||
|
@ -229,6 +230,7 @@ export class KernelVariables implements IJupyterVariables {
|
|||
value: undefined,
|
||||
supportsDataExplorer: false,
|
||||
type: v.type,
|
||||
fullType: v.fullType,
|
||||
size: 0,
|
||||
shape: '',
|
||||
count: 0,
|
||||
|
|
|
@ -190,15 +190,18 @@ export class PythonVariablesRequester implements IKernelVariableRequester {
|
|||
if (kernel.disposed || kernel.disposing) {
|
||||
return [];
|
||||
}
|
||||
const varNameTypeMap = this.deserializeJupyterResult(results) as Map<String, String>;
|
||||
const variables = this.deserializeJupyterResult(results) as {
|
||||
name: string;
|
||||
type: string;
|
||||
fullType: string;
|
||||
}[];
|
||||
|
||||
const vars = [];
|
||||
for (const [name, type] of Object.entries(varNameTypeMap)) {
|
||||
for (const variable of variables) {
|
||||
const v: IJupyterVariable = {
|
||||
name: name,
|
||||
...variable,
|
||||
value: undefined,
|
||||
supportsDataExplorer: false,
|
||||
type: type || '',
|
||||
size: 0,
|
||||
shape: '',
|
||||
count: 0,
|
||||
|
|
Загрузка…
Ссылка в новой задаче