From 1329b7bc49f2c3286dd1e5d8a4f6f08491f0ddf4 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Sun, 24 Jul 2016 23:32:09 +0200 Subject: [PATCH] adopt latest debug protocol --- extensions/node-debug/node-debug.azure.json | 2 +- .../parts/debug/common/debugModel.ts | 6 ++-- .../parts/debug/common/debugProtocol.d.ts | 34 +++++++++++++------ 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/extensions/node-debug/node-debug.azure.json b/extensions/node-debug/node-debug.azure.json index d2af75a6676..40242dbe62f 100644 --- a/extensions/node-debug/node-debug.azure.json +++ b/extensions/node-debug/node-debug.azure.json @@ -1,6 +1,6 @@ { "account": "monacobuild", "container": "debuggers", - "zip": "be96393/node-debug.zip", + "zip": "a4e908a/node-debug.zip", "output": "" } diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index 74a3116fa3b..ab9b22489f4 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -39,7 +39,7 @@ export function evaluateExpression(session: debug.IRawDebugSession, stackFrame: if (response.body) { expression.value = response.body.result; expression.reference = response.body.variablesReference; - expression.childrenCount = response.body.totalVariables; + expression.childrenCount = response.body.indexedVariables; expression.type = response.body.type; } @@ -265,7 +265,7 @@ export abstract class ExpressionContainer implements debug.IExpressionContainer count }).then(response => { return arrays.distinct(response.body.variables.filter(v => !!v), v => v.name).map( - v => new Variable(this, v.variablesReference, v.name, v.value, v.totalVariables, v.type) + v => new Variable(this, v.variablesReference, v.name, v.value, v.indexedVariables, v.type) ); }, (e: Error) => [new Variable(this, 0, null, e.message, 0, null, false)]); } @@ -364,7 +364,7 @@ export class StackFrame implements debug.IStackFrame { public getScopes(debugService: debug.IDebugService): TPromise { if (!this.scopes) { this.scopes = debugService.getActiveSession().scopes({ frameId: this.frameId }).then(response => { - return response.body.scopes.map(rs => new Scope(this.threadId, rs.name, rs.variablesReference, rs.expensive, rs.totalVariables)); + return response.body.scopes.map(rs => new Scope(this.threadId, rs.name, rs.variablesReference, rs.expensive, rs.indexedVariables)); }, err => []); } diff --git a/src/vs/workbench/parts/debug/common/debugProtocol.d.ts b/src/vs/workbench/parts/debug/common/debugProtocol.d.ts index 99c28bdb08a..441308e4d32 100644 --- a/src/vs/workbench/parts/debug/common/debugProtocol.d.ts +++ b/src/vs/workbench/parts/debug/common/debugProtocol.d.ts @@ -513,7 +513,8 @@ declare module DebugProtocol { } /** Variables request; value of command field is "variables". - Retrieves all variables (or a range thereof) for the given variable reference. + Retrieves all child variables for the given variable reference. + An optional filter can be used to limit the fetched children to either named or indexed children. */ export interface VariablesRequest extends Request { arguments: VariablesArguments; @@ -522,6 +523,8 @@ declare module DebugProtocol { export interface VariablesArguments { /** The Variable reference. */ variablesReference: number; + /** Optional filter to limit the child variables to either named or indexed. If ommited, both types are fetched. */ + filter?: "indexed" | "named"; /** The index of the first variable to return; if omitted children start at 0. */ start?: number; /** The number of variables to return. If count is missing or 0, all variables are returned. */ @@ -640,10 +643,12 @@ declare module DebugProtocol { type?: string; /** If variablesReference is > 0, the evaluate result is structured and its children can be retrieved by passing variablesReference to the VariablesRequest */ variablesReference: number; - /** The total number of child variables. - If this number is large, the number should be returned via the optional 'totalVariables' attribute. - The client can use this information to present the variables in a paged UI and fetch them in chunks. */ - totalVariables?: number; + /** The number of named child variables. + The client can use this optional information to present the variables in a paged UI and fetch them in chunks. */ + namedVariables?: number; + /** The number of indexed child variables. + The client can use this optional information to present the variables in a paged UI and fetch them in chunks. */ + indexedVariables?: number; }; } @@ -892,9 +897,12 @@ declare module DebugProtocol { name: string; /** The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest. */ variablesReference: number; - /** The total number of variables in this scope. + /** The number of named variables in this scope. The client can use this optional information to present the variables in a paged UI and fetch them in chunks. */ - totalVariables?: number; + namedVariables?: number; + /** The number of indexed variables in this scope. + The client can use this optional information to present the variables in a paged UI and fetch them in chunks. */ + indexedVariables?: number; /** If true, the number of variables in this scope is large or expensive to retrieve. */ expensive: boolean; } @@ -913,12 +921,16 @@ declare module DebugProtocol { type?: string; /** The variable's value. For structured objects this can be a multi line text, e.g. for a function the body of a function. */ value: string; - /** If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. */ - variablesReference: number; - /** The total number of child variables. */ - totalVariables?: number; /** Properties of a variable that can be used to determine how to render the variable in the UI. Format of the string value: TBD. */ kind?: string; + /** If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. */ + variablesReference: number; + /** The number of named child variables in this scope. + The client can use this optional information to present the children in a paged UI and fetch them in chunks. */ + namedVariables?: number; + /** The number of indexed child variables in this scope. + The client can use this optional information to present the children in a paged UI and fetch them in chunks. */ + indexedVariables?: number; } /** Properties of a breakpoint passed to the setBreakpoints request.