mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
fixes #87235
This commit is contained in:
@@ -118,9 +118,12 @@ export class ExpressionContainer implements IExpressionContainer {
|
||||
try {
|
||||
const response = await this.session!.variables(this.reference || 0, this.threadId, filter, start, count);
|
||||
return response && response.body && response.body.variables
|
||||
? distinct(response.body.variables.filter(v => !!v && isString(v.name)), (v: DebugProtocol.Variable) => v.name).map((v: DebugProtocol.Variable) =>
|
||||
new Variable(this.session, this.threadId, this, v.variablesReference, v.name, v.evaluateName, v.value, v.namedVariables, v.indexedVariables, v.presentationHint, v.type))
|
||||
: [];
|
||||
? distinct(response.body.variables.filter(v => !!v), v => v.name).map(v => {
|
||||
if (isString(v.value) && isString(v.name) && typeof v.variablesReference === 'number') {
|
||||
return new Variable(this.session, this.threadId, this, v.variablesReference, v.name, v.evaluateName, v.value, v.namedVariables, v.indexedVariables, v.presentationHint, v.type);
|
||||
}
|
||||
return new Variable(this.session, this.threadId, this, 0, '', undefined, nls.localize('invalidVariableAttributes', "Invalid variable attributes"), 0, 0, { kind: 'virtual' }, undefined, false);
|
||||
}) : [];
|
||||
} catch (e) {
|
||||
return [new Variable(this.session, this.threadId, this, 0, '', undefined, e.message, 0, 0, { kind: 'virtual' }, undefined, false)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user