From 529de9fc3f104711c9fa480ac0e1e1046e0fbc9f Mon Sep 17 00:00:00 2001 From: Richard Stanton Date: Wed, 19 Oct 2016 16:14:42 -0700 Subject: [PATCH 1/2] Allow requests to specify formatting hints. --- debugProtocol.json | 61 +++++++++++++++++++++++++++++++++++ protocol/src/debugProtocol.ts | 30 +++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/debugProtocol.json b/debugProtocol.json index 6cff7e9..db2f9b0 100644 --- a/debugProtocol.json +++ b/debugProtocol.json @@ -1096,6 +1096,10 @@ "levels": { "type": "integer", "description": "The maximum number of frames to return. If levels is not specified or 0, all frames are returned." + }, + "format": { + "$ref": "#/definitions/StackFrameFormat", + "description": "Specifies details on how to format the stack frames." } }, "required": [ "threadId" ] @@ -1213,6 +1217,10 @@ "count": { "type": "integer", "description": "The number of variables to return. If count is missing or 0, all variables are returned." + }, + "format": { + "$ref": "#/definitions/ValueFormat", + "description": "Specifies details on how to format the values." } }, "required": [ "variablesReference" ] @@ -1271,6 +1279,10 @@ "value": { "type": "string", "description": "The value of the variable." + }, + "format": { + "$ref": "#/definitions/ValueFormat", + "description": "Specifies details on the format of the value." } }, "required": [ "variablesReference", "name", "value" ] @@ -1487,6 +1499,10 @@ "type": "string", "_enum": [ "watch", "repl", "hover" ], "description": "The context in which the evaluate request is run. Possible values are 'watch' if evaluate is run in a watch, 'repl' if run from the REPL console, or 'hover' if run from a data hover." + }, + "format": { + "$ref": "#/definitions/ValueFormat", + "description": "Specifies details on how to format the result." } }, "required": [ "expression" ] @@ -2287,6 +2303,51 @@ } }, "required": [ "algorithm", "checksum" ] + }, + + "ValueFormat": { + "type": "object", + "description": "Provides formatting information for a value.", + "properties": { + "hex": { + "type": "boolean", + "description": "Displays the value in hex." + } + } + }, + + "StackFrameFormat": { + "allOf": [ { "$ref": "#/definitions/ValueFormat" }, { + "type": "object", + "description": "Provides formatting information for a stack frame.", + "properties": { + "parameters": { + "type": "boolean", + "description": "Displays parameters for the stack frame." + }, + "parameterTypes": { + "type": "boolean", + "description": "Displays the types of parameters for the stack frame." + }, + "parameterNames": { + "type": "boolean", + "description": "Displays the names of parameters for the stack frame." + }, + "parameterValues": { + "type": "boolean", + "description": "Displays the values of parameters for the stack frame." + }, + "line": { + "type": "boolean", + "description": "Displays the line number of the stack frame." + }, + "module": { + "type": "boolean", + "description": "Displays the module of the stack frame." + } + } + }] } + } } \ No newline at end of file diff --git a/protocol/src/debugProtocol.ts b/protocol/src/debugProtocol.ts index a9637c8..affbd05 100644 --- a/protocol/src/debugProtocol.ts +++ b/protocol/src/debugProtocol.ts @@ -570,6 +570,8 @@ export module DebugProtocol { startFrame?: number; /** The maximum number of frames to return. If levels is not specified or 0, all frames are returned. */ levels?: number; + /** Specifies details on how to format the stack frames. */ + format?: StackFrameFormat; } /** Response to 'stackTrace' request. */ @@ -625,6 +627,8 @@ export module DebugProtocol { start?: number; /** The number of variables to return. If count is missing or 0, all variables are returned. */ count?: number; + /** Specifies details on how to format the values. */ + format?: ValueFormat; } /** Response to 'variables' request. */ @@ -651,6 +655,8 @@ export module DebugProtocol { name: string; /** The value of the variable. */ value: string; + /** Specifies details on the format of the value. */ + format?: ValueFormat; } /** Response to 'setVariable' request. */ @@ -753,6 +759,8 @@ export module DebugProtocol { frameId?: number; /** The context in which the evaluate request is run. Possible values are 'watch' if evaluate is run in a watch, 'repl' if run from the REPL console, or 'hover' if run from a data hover. */ context?: string; + /** Specifies details on how to format the result. */ + format?: ValueFormat; } /** Response to 'evaluate' request. */ @@ -1177,5 +1185,27 @@ export module DebugProtocol { /** Value of the checksum. */ checksum: string; } + + /** Provides formatting information for a value. */ + export interface ValueFormat { + /** Displays the value in hex. */ + hex?: boolean; + } + + /** Provides formatting information for a stack frame. */ + export interface StackFrameFormat extends ValueFormat { + /** Displays parameters for the stack frame. */ + parameters?: boolean; + /** Displays the types of parameters for the stack frame. */ + parameterTypes?: boolean; + /** Displays the names of parameters for the stack frame. */ + parameterNames?: boolean; + /** Displays the values of parameters for the stack frame. */ + parameterValues?: boolean; + /** Displays the line number of the stack frame. */ + line?: boolean; + /** Displays the module of the stack frame. */ + module?: boolean; + } } From 7201229c528562e53df4f9170618b0b075edc1eb Mon Sep 17 00:00:00 2001 From: Richard Stanton Date: Thu, 27 Oct 2016 09:35:24 -0700 Subject: [PATCH 2/2] Remove format from setVariable request --- debugProtocol.json | 4 ---- protocol/src/debugProtocol.ts | 2 -- 2 files changed, 6 deletions(-) diff --git a/debugProtocol.json b/debugProtocol.json index db2f9b0..4498db7 100644 --- a/debugProtocol.json +++ b/debugProtocol.json @@ -1279,10 +1279,6 @@ "value": { "type": "string", "description": "The value of the variable." - }, - "format": { - "$ref": "#/definitions/ValueFormat", - "description": "Specifies details on the format of the value." } }, "required": [ "variablesReference", "name", "value" ] diff --git a/protocol/src/debugProtocol.ts b/protocol/src/debugProtocol.ts index affbd05..e0a373e 100644 --- a/protocol/src/debugProtocol.ts +++ b/protocol/src/debugProtocol.ts @@ -655,8 +655,6 @@ export module DebugProtocol { name: string; /** The value of the variable. */ value: string; - /** Specifies details on the format of the value. */ - format?: ValueFormat; } /** Response to 'setVariable' request. */