add new field to param argument passed to open data viewer command (#15652)

This commit is contained in:
Aaron Munger 2024-05-03 08:23:46 -07:00 коммит произвёл GitHub
Родитель 0b1fe581a0
Коммит d3dc06fdb1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 19 добавлений и 6 удалений

Просмотреть файл

@ -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,