Skip to content

Commit

Permalink
add condition support for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
weinand committed Nov 23, 2020
1 parent 8bf487c commit f8e8752
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 54 deletions.
8 changes: 4 additions & 4 deletions adapter/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vscode-debugadapter",
"description": "Debug adapter implementation for node",
"version": "1.42.1",
"version": "1.43.0-pre.0",
"author": "Microsoft Corporation",
"license": "MIT",
"repository": {
Expand All @@ -19,7 +19,7 @@
"typings": "./lib/main",
"dependencies": {
"mkdirp": "^0.5.5",
"vscode-debugprotocol": "1.42.0"
"vscode-debugprotocol": "1.43.0-pre.0"
},
"devDependencies": {
"@types/mkdirp": "^0.5.2",
Expand Down
3 changes: 3 additions & 0 deletions adapter/src/debugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,9 @@ export class DebugSession extends ProtocolServer {
/** The debug adapter does not support the 'setInstructionBreakpoints' request. */
response.body.supportsInstructionBreakpoints = false;

/** The debug adapter does not support 'filterOptions' on the 'setExceptionBreakpoints' request. */
response.body.supportsExceptionFilterOptions = false;

this.sendResponse(response);
}

Expand Down
71 changes: 51 additions & 20 deletions debugProtocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
},
"variablesReference": {
"type": "integer",
"description": "If an attribute 'variablesReference' exists and its value is > 0, the output contains objects which can be retrieved by passing 'variablesReference' to the 'variables' request. The value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "If an attribute 'variablesReference' exists and its value is > 0, the output contains objects which can be retrieved by passing 'variablesReference' to the 'variables' request. The value should be less than or equal to 2147483647 (2^31-1)."
},
"source": {
"$ref": "#/definitions/Source",
Expand Down Expand Up @@ -716,7 +716,7 @@
},
"cwd": {
"type": "string",
"description": "Working directory of the command."
"description": "Working directory for the command. For non-empty, valid paths this typically results in execution of a change directory command."
},
"args": {
"type": "array",
Expand Down Expand Up @@ -746,11 +746,11 @@
"properties": {
"processId": {
"type": "integer",
"description": "The process ID. The value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "The process ID. The value should be less than or equal to 2147483647 (2^31-1)."
},
"shellProcessId": {
"type": "integer",
"description": "The process ID of the terminal shell. The value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "The process ID of the terminal shell. The value should be less than or equal to 2147483647 (2^31-1)."
}
}
}
Expand Down Expand Up @@ -1256,7 +1256,14 @@
"items": {
"type": "string"
},
"description": "IDs of checked exception options. The set of IDs is returned via the 'exceptionBreakpointFilters' capability."
"description": "Set of exception filters specified by their ID. The set of all possible exception filters is defined by the 'exceptionBreakpointFilters' capability."
},
"filterOptions": {
"type": "array",
"items": {
"$ref": "#/definitions/ExceptionFilterOptions"
},
"description": "Set of exception filters and their options. The set of all possible exception filters is defined by the 'exceptionBreakpointFilters' capability. This attribute is only honored by a debug adapter if the capability 'supportsExceptionFilterOptions' is true."
},
"exceptionOptions": {
"type": "array",
Expand Down Expand Up @@ -2033,15 +2040,15 @@
},
"variablesReference": {
"type": "integer",
"description": "If variablesReference is > 0, the new value is structured and its children can be retrieved by passing variablesReference to the VariablesRequest.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "If variablesReference is > 0, the new value is structured and its children can be retrieved by passing variablesReference to the VariablesRequest.\nThe value should be less than or equal to 2147483647 (2^31-1)."
},
"namedVariables": {
"type": "integer",
"description": "The number of named child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "The number of named child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
},
"indexedVariables": {
"type": "integer",
"description": "The number of indexed child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "The number of indexed child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
}
},
"required": [ "value" ]
Expand Down Expand Up @@ -2346,15 +2353,15 @@
},
"variablesReference": {
"type": "integer",
"description": "If variablesReference is > 0, the evaluate result is structured and its children can be retrieved by passing variablesReference to the VariablesRequest.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "If variablesReference is > 0, the evaluate result is structured and its children can be retrieved by passing variablesReference to the VariablesRequest.\nThe value should be less than or equal to 2147483647 (2^31-1)."
},
"namedVariables": {
"type": "integer",
"description": "The number of named child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "The number of named child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
},
"indexedVariables": {
"type": "integer",
"description": "The number of indexed child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "The number of indexed child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
},
"memoryReference": {
"type": "string",
Expand Down Expand Up @@ -2429,15 +2436,15 @@
},
"variablesReference": {
"type": "integer",
"description": "If variablesReference is > 0, the value is structured and its children can be retrieved by passing variablesReference to the VariablesRequest.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "If variablesReference is > 0, the value is structured and its children can be retrieved by passing variablesReference to the VariablesRequest.\nThe value should be less than or equal to 2147483647 (2^31-1)."
},
"namedVariables": {
"type": "integer",
"description": "The number of named child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "The number of named child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
},
"indexedVariables": {
"type": "integer",
"description": "The number of indexed child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "The number of indexed child variables.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
}
},
"required": [ "value" ]
Expand Down Expand Up @@ -2833,7 +2840,7 @@
"items": {
"$ref": "#/definitions/ExceptionBreakpointsFilter"
},
"description": "Available filters or options for the setExceptionBreakpoints request."
"description": "Available exception filter options for the 'setExceptionBreakpoints' request."
},
"supportsStepBack": {
"type": "boolean",
Expand Down Expand Up @@ -2959,25 +2966,33 @@
"supportsInstructionBreakpoints": {
"type": "boolean",
"description": "The debug adapter supports adding breakpoints based on instruction references."
},
"supportsExceptionFilterOptions": {
"type": "boolean",
"description": "The debug adapter supports 'filterOptions' as an argument on the 'setExceptionBreakpoints' request."
}
}
},

"ExceptionBreakpointsFilter": {
"type": "object",
"description": "An ExceptionBreakpointsFilter is shown in the UI as an option for configuring how exceptions are dealt with.",
"description": "An ExceptionBreakpointsFilter is shown in the UI as an filter option for configuring how exceptions are dealt with.",
"properties": {
"filter": {
"type": "string",
"description": "The internal ID of the filter. This value is passed to the setExceptionBreakpoints request."
"description": "The internal ID of the filter option. This value is passed to the 'setExceptionBreakpoints' request."
},
"label": {
"type": "string",
"description": "The name of the filter. This will be shown in the UI."
"description": "The name of the filter option. This will be shown in the UI."
},
"default": {
"type": "boolean",
"description": "Initial value of the filter. If not specified a value 'false' is assumed."
"description": "Initial value of the filter option. If not specified a value 'false' is assumed."
},
"supportsCondition": {
"type": "boolean",
"description": "Controls whether a condition can be specified for this filter option. If false or missing, a condition can not be set."
}
},
"required": [ "filter", "label" ]
Expand Down Expand Up @@ -3144,7 +3159,7 @@
},
"sourceReference": {
"type": "integer",
"description": "If sourceReference > 0 the contents of the source must be retrieved through the SourceRequest (even if a path is specified).\nA sourceReference is only valid for a session, so it must not be used to persist a source.\nThe value should be less than or equal to 2147483647 (2^31 - 1)."
"description": "If sourceReference > 0 the contents of the source must be retrieved through the SourceRequest (even if a path is specified).\nA sourceReference is only valid for a session, so it must not be used to persist a source.\nThe value should be less than or equal to 2147483647 (2^31-1)."
},
"presentationHint": {
"type": "string",
Expand Down Expand Up @@ -3727,6 +3742,22 @@
}]
},

"ExceptionFilterOptions": {
"type": "object",
"description": "An ExceptionFilterOptions is used to specify an exception filter together with a condition for the setExceptionsFilter request.",
"properties": {
"filterId": {
"type": "string",
"description": "ID of an exception filter returned by the 'exceptionBreakpointFilters' capability."
},
"condition": {
"type": "string",
"description": "An optional expression for conditional exceptions.\nThe exception will break into the debugger if the result of the condition is true."
}
},
"required": [ "filterId" ]
},

"ExceptionOptions": {
"type": "object",
"description": "An ExceptionOptions assigns configuration options to a set of exceptions.",
Expand Down
2 changes: 1 addition & 1 deletion protocol/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protocol/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vscode-debugprotocol",
"description": "Npm module with declarations for the Visual Studio Code debug protocol",
"version": "1.42.0",
"version": "1.43.0-pre.0",
"author": "Microsoft Corporation",
"license": "MIT",
"repository": {
Expand Down
Loading

0 comments on commit f8e8752

Please sign in to comment.