From fa1432ffc87c16344d741e8571f12f9b40e531d9 Mon Sep 17 00:00:00 2001 From: fwcd Date: Wed, 2 Sep 2020 17:10:04 +0200 Subject: [PATCH] Add EnhancedDebugSession.getVariables --- .../src/debugger/EnhancedDebugSession.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/extension/src/debugger/EnhancedDebugSession.ts b/extension/src/debugger/EnhancedDebugSession.ts index 42e8926..5e8a00e 100644 --- a/extension/src/debugger/EnhancedDebugSession.ts +++ b/extension/src/debugger/EnhancedDebugSession.ts @@ -46,6 +46,23 @@ export class EnhancedDebugSession { } } + public async getVariables(args: { + variablesReference: number + }): Promise { + try { + const reply = await this.session.customRequest("variables", { + variablesReference: args.variablesReference + }); + if (!reply) { + return []; + } + return reply.variables; + } catch (error) { + console.error(error); + return []; + } + } + /** * Evaluates the given expression. * If context is "watch", long results are usually shortened. @@ -64,6 +81,13 @@ export class EnhancedDebugSession { return { result: reply.result, variablesReference: reply.variablesReference }; } } + +interface Variable { + name: string; + value: string; + variablesReference: number; +} + interface StackFrame { id: number; name: string;