diff --git a/.gitignore b/.gitignore index 819428e..7f8819c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +_opam _build .DS_Store node_modules diff --git a/dap.opam b/dap.opam index 66e66b9..d536d2b 100644 --- a/dap.opam +++ b/dap.opam @@ -14,6 +14,7 @@ depends: [ "ocaml" {>= "4.08"} "dune" {>= "2.7"} "yojson" + "fmt" "ppx_here" "ppx_deriving" "ppx_deriving_yojson" diff --git a/debugAdapterProtocol.json b/debugAdapterProtocol.json index 3471f7e..51737da 100644 --- a/debugAdapterProtocol.json +++ b/debugAdapterProtocol.json @@ -14,7 +14,7 @@ "properties": { "seq": { "type": "integer", - "description": "Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request." + "description": "Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request." }, "type": { "type": "string", @@ -84,7 +84,7 @@ }, "success": { "type": "boolean", - "description": "Outcome of the request.\nIf true, the request was successful and the 'body' attribute may contain the result of the request.\nIf the value is false, the attribute 'message' contains the error in short form and the 'body' may contain additional information (see 'ErrorResponse.body.error')." + "description": "Outcome of the request.\nIf true, the request was successful and the `body` attribute may contain the result of the request.\nIf the value is false, the attribute `message` contains the error in short form and the `body` may contain additional information (see `ErrorResponse.body.error`)." }, "command": { "type": "string", @@ -92,15 +92,16 @@ }, "message": { "type": "string", - "description": "Contains the raw error in short form if 'success' is false.\nThis raw error might be interpreted by the frontend and is not shown in the UI.\nSome predefined values exist.", - "_enum": [ "cancelled" ], + "description": "Contains the raw error in short form if `success` is false.\nThis raw error might be interpreted by the client and is not shown in the UI.\nSome predefined values exist.", + "_enum": [ "cancelled", "notStopped" ], "enumDescriptions": [ - "request was cancelled." + "the request was cancelled.", + "the request may be retried once the adapter is in a 'stopped' state." ] }, "body": { "type": [ "array", "boolean", "integer", "null", "number" , "object", "string" ], - "description": "Contains request result if success is true and optional error details if success is false." + "description": "Contains request result if success is true and error details if success is false." } }, "required": [ "type", "request_seq", "success", "command" ] @@ -110,14 +111,14 @@ "ErrorResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "On error (whenever 'success' is false), the body can provide more details.", + "description": "On error (whenever `success` is false), the body can provide more details.", "properties": { "body": { "type": "object", "properties": { "error": { "$ref": "#/definitions/Message", - "description": "An optional, structured error message." + "description": "A structured error message." } } } @@ -129,7 +130,7 @@ "CancelRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The 'cancel' request is used by the frontend in two situations:\n- to indicate that it is no longer interested in the result produced by a specific request issued earlier\n- to cancel a progress sequence. Clients should only call this request if the capability 'supportsCancelRequest' is true.\nThis request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honouring this request but there are no guarantees.\nThe 'cancel' request may return an error if it could not cancel an operation but a frontend should refrain from presenting this error to end users.\nA frontend client should only call this request if the capability 'supportsCancelRequest' is true.\nThe request that got canceled still needs to send a response back. This can either be a normal result ('success' attribute true)\nor an error response ('success' attribute false and the 'message' set to 'cancelled').\nReturning partial results from a cancelled request is possible but please note that a frontend client has no generic way for detecting that a response is partial or not.\n The progress that got cancelled still needs to send a 'progressEnd' event back.\n A client should not assume that progress just got cancelled after sending the 'cancel' request.", + "description": "The `cancel` request is used by the client in two situations:\n- to indicate that it is no longer interested in the result produced by a specific request issued earlier\n- to cancel a progress sequence.\nClients should only call this request if the corresponding capability `supportsCancelRequest` is true.\nThis request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees.\nThe `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users.\nThe request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`).\nReturning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not.\nThe progress that got cancelled still needs to send a `progressEnd` event back.\n A client should not assume that progress just got cancelled after sending the `cancel` request.", "properties": { "command": { "type": "string", @@ -144,22 +145,22 @@ }, "CancelArguments": { "type": "object", - "description": "Arguments for 'cancel' request.", + "description": "Arguments for `cancel` request.", "properties": { "requestId": { "type": "integer", - "description": "The ID (attribute 'seq') of the request to cancel. If missing no request is cancelled.\nBoth a 'requestId' and a 'progressId' can be specified in one request." + "description": "The ID (attribute `seq`) of the request to cancel. If missing no request is cancelled.\nBoth a `requestId` and a `progressId` can be specified in one request." }, "progressId": { "type": "string", - "description": "The ID (attribute 'progressId') of the progress to cancel. If missing no progress is cancelled.\nBoth a 'requestId' and a 'progressId' can be specified in one request." + "description": "The ID (attribute `progressId`) of the progress to cancel. If missing no progress is cancelled.\nBoth a `requestId` and a `progressId` can be specified in one request." } } }, "CancelResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'cancel' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `cancel` request. This is just an acknowledgement, so no body field is required." }] }, @@ -167,7 +168,7 @@ "allOf": [ { "$ref": "#/definitions/Event" }, { "type": "object", "title": "Events", - "description": "This event indicates that the debug adapter is ready to accept configuration requests (e.g. SetBreakpointsRequest, SetExceptionBreakpointsRequest).\nA debug adapter is expected to send this event when it is ready to accept configuration requests (but not before the 'initialize' request has finished).\nThe sequence of events/requests is as follows:\n- adapters sends 'initialized' event (after the 'initialize' request has returned)\n- frontend sends zero or more 'setBreakpoints' requests\n- frontend sends one 'setFunctionBreakpoints' request (if capability 'supportsFunctionBreakpoints' is true)\n- frontend sends a 'setExceptionBreakpoints' request if one or more 'exceptionBreakpointFilters' have been defined (or if 'supportsConfigurationDoneRequest' is not defined or false)\n- frontend sends other future configuration requests\n- frontend sends one 'configurationDone' request to indicate the end of the configuration.", + "description": "This event indicates that the debug adapter is ready to accept configuration requests (e.g. `setBreakpoints`, `setExceptionBreakpoints`).\nA debug adapter is expected to send this event when it is ready to accept configuration requests (but not before the `initialize` request has finished).\nThe sequence of events/requests is as follows:\n- adapters sends `initialized` event (after the `initialize` request has returned)\n- client sends zero or more `setBreakpoints` requests\n- client sends one `setFunctionBreakpoints` request (if corresponding capability `supportsFunctionBreakpoints` is true)\n- client sends a `setExceptionBreakpoints` request if one or more `exceptionBreakpointFilters` have been defined (or if `supportsConfigurationDoneRequest` is not true)\n- client sends other future configuration requests\n- client sends one `configurationDone` request to indicate the end of the configuration.", "properties": { "event": { "type": "string", @@ -181,7 +182,7 @@ "StoppedEvent": { "allOf": [ { "$ref": "#/definitions/Event" }, { "type": "object", - "description": "The event indicates that the execution of the debuggee has stopped due to some condition.\nThis can be caused by a break point previously set, a stepping request has completed, by executing a debugger statement etc.", + "description": "The event indicates that the execution of the debuggee has stopped due to some condition.\nThis can be caused by a breakpoint previously set, a stepping request has completed, by executing a debugger statement etc.", "properties": { "event": { "type": "string", @@ -192,12 +193,12 @@ "properties": { "reason": { "type": "string", - "description": "The reason for the event.\nFor backward compatibility this string is shown in the UI if the 'description' attribute is missing (but it must not be translated).", + "description": "The reason for the event.\nFor backward compatibility this string is shown in the UI if the `description` attribute is missing (but it must not be translated).", "_enum": [ "step", "breakpoint", "exception", "pause", "entry", "goto", "function breakpoint", "data breakpoint", "instruction breakpoint" ] }, "description": { "type": "string", - "description": "The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is and must be translated." + "description": "The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is and can be translated." }, "threadId": { "type": "integer", @@ -205,15 +206,22 @@ }, "preserveFocusHint": { "type": "boolean", - "description": "A value of true hints to the frontend that this event should not change the focus." + "description": "A value of true hints to the client that this event should not change the focus." }, "text": { "type": "string", - "description": "Additional information. E.g. if reason is 'exception', text contains the exception name. This string is shown in the UI." + "description": "Additional information. E.g. if reason is `exception`, text contains the exception name. This string is shown in the UI." }, "allThreadsStopped": { "type": "boolean", - "description": "If 'allThreadsStopped' is true, a debug adapter can announce that all threads have stopped.\n- The client should use this information to enable that all threads can be expanded to access their stacktraces.\n- If the attribute is missing or false, only the thread with the given threadId can be expanded." + "description": "If `allThreadsStopped` is true, a debug adapter can announce that all threads have stopped.\n- The client should use this information to enable that all threads can be expanded to access their stacktraces.\n- If the attribute is missing or false, only the thread with the given `threadId` can be expanded." + }, + "hitBreakpointIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "Ids of the breakpoints that triggered the event. In most cases there is only a single breakpoint but here are some examples for multiple breakpoints:\n- Different types of breakpoints map to the same location.\n- Multiple source breakpoints get collapsed to the same instruction by the compiler/runtime.\n- Multiple function breakpoints with different function names map to the same location." } }, "required": [ "reason" ] @@ -226,7 +234,7 @@ "ContinuedEvent": { "allOf": [ { "$ref": "#/definitions/Event" }, { "type": "object", - "description": "The event indicates that the execution of the debuggee has continued.\nPlease note: a debug adapter is not expected to send this event in response to a request that implies that execution continues, e.g. 'launch' or 'continue'.\nIt is only necessary to send a 'continued' event if there was no previous request that implied this.", + "description": "The event indicates that the execution of the debuggee has continued.\nPlease note: a debug adapter is not expected to send this event in response to a request that implies that execution continues, e.g. `launch` or `continue`.\nIt is only necessary to send a `continued` event if there was no previous request that implied this.", "properties": { "event": { "type": "string", @@ -241,7 +249,7 @@ }, "allThreadsContinued": { "type": "boolean", - "description": "If 'allThreadsContinued' is true, a debug adapter can announce that all threads have continued." + "description": "If `allThreadsContinued` is true, a debug adapter can announce that all threads have continued." } }, "required": [ "threadId" ] @@ -289,7 +297,7 @@ "properties": { "restart": { "type": [ "array", "boolean", "integer", "null", "number", "object", "string" ], - "description": "A debug adapter may set 'restart' to true (or to an arbitrary object) to request that the front end restarts the session.\nThe value is not interpreted by the client and passed unmodified as an attribute '__restart' to the 'launch' and 'attach' requests." + "description": "A debug adapter may set `restart` to true (or to an arbitrary object) to request that the client restarts the session.\nThe value is not interpreted by the client and passed unmodified as an attribute `__restart` to the `launch` and `attach` requests." } } } @@ -341,42 +349,53 @@ "properties": { "category": { "type": "string", - "description": "The output category. If not specified, 'console' is assumed.", - "_enum": [ "console", "stdout", "stderr", "telemetry" ] + "description": "The output category. If not specified or if the category is not understood by the client, `console` is assumed.", + "_enum": [ "console", "important", "stdout", "stderr", "telemetry" ], + "enumDescriptions": [ + "Show the output in the client's default message UI, e.g. a 'debug console'. This category should only be used for informational output from the debugger (as opposed to the debuggee).", + "A hint for the client to show the output in the client's UI for important and highly visible information, e.g. as a popup notification. This category should only be used for important messages from the debugger (as opposed to the debuggee). Since this category value is a hint, clients might ignore the hint and assume the `console` category.", + "Show the output as normal program output from the debuggee.", + "Show the output as error program output from the debuggee.", + "Send the output to telemetry instead of showing it to the user." + ] }, "output": { "type": "string", - "description": "The output to report." + "description": "The output to report.\n\nANSI escape sequences may be used to influence text color and styling if `supportsANSIStyling` is present in both the adapter's `Capabilities` and the client's `InitializeRequestArguments`. A client may strip any unrecognized ANSI sequences.\n\nIf the `supportsANSIStyling` capabilities are not both true, then the client should display the output literally." }, "group": { "type": "string", "description": "Support for keeping an output log organized by grouping related messages.", "enum": [ "start", "startCollapsed", "end" ], "enumDescriptions": [ - "Start a new group in expanded mode. Subsequent output events are members of the group and should be shown indented.\nThe 'output' attribute becomes the name of the group and is not indented.", - "Start a new group in collapsed mode. Subsequent output events are members of the group and should be shown indented (as soon as the group is expanded).\nThe 'output' attribute becomes the name of the group and is not indented.", - "End the current group and decreases the indentation of subsequent output events.\nA non empty 'output' attribute is shown as the unindented end of the group." + "Start a new group in expanded mode. Subsequent output events are members of the group and should be shown indented.\nThe `output` attribute becomes the name of the group and is not indented.", + "Start a new group in collapsed mode. Subsequent output events are members of the group and should be shown indented (as soon as the group is expanded).\nThe `output` attribute becomes the name of the group and is not indented.", + "End the current group and decrease the indentation of subsequent output events.\nA non-empty `output` attribute is shown as the unindented end of the group." ] }, "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 as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details." }, "source": { "$ref": "#/definitions/Source", - "description": "An optional source location where the output was produced." + "description": "The source location where the output was produced." }, "line": { "type": "integer", - "description": "An optional source location line where the output was produced." + "description": "The source location's line where the output was produced." }, "column": { "type": "integer", - "description": "An optional source location column where the output was produced." + "description": "The position in `line` where the output was produced. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." }, "data": { "type": [ "array", "boolean", "integer", "null", "number" , "object", "string" ], - "description": "Optional data to report. For the 'telemetry' category the data will be sent to telemetry, for the other categories the data is shown in JSON format." + "description": "Additional data to report. For the `telemetry` category the data is sent to telemetry, for the other categories the data is shown in JSON format." + }, + "locationReference": { + "type": "integer", + "description": "A reference that allows the client to request the location where the new value is declared. For example, if the logged value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details." } }, "required": ["output"] @@ -405,7 +424,7 @@ }, "breakpoint": { "$ref": "#/definitions/Breakpoint", - "description": "The 'id' attribute is used to find the target breakpoint and the other attributes are used as the new values." + "description": "The `id` attribute is used to find the target breakpoint, the other attributes are used as the new values." } }, "required": [ "reason", "breakpoint" ] @@ -434,7 +453,7 @@ }, "module": { "$ref": "#/definitions/Module", - "description": "The new, changed, or removed module. In case of 'removed' only the module id is used." + "description": "The new, changed, or removed module. In case of `removed` only the module id is used." } }, "required": [ "reason", "module" ] @@ -493,7 +512,7 @@ }, "systemProcessId": { "type": "integer", - "description": "The system process id of the debugged process. This property will be missing for non-system processes." + "description": "The process ID of the debugged process, as assigned by the operating system. This property should be omitted for logical processes that do not map to operating system processes on the machine." }, "isLocalProcess": { "type": "boolean", @@ -525,7 +544,7 @@ "CapabilitiesEvent": { "allOf": [ { "$ref": "#/definitions/Event" }, { "type": "object", - "description": "The event indicates that one or more capabilities have changed.\nSince the capabilities are dependent on the frontend and its UI, it might not be possible to change that at random times (or too late).\nConsequently this event has a hint characteristic: a frontend can only be expected to make a 'best effort' in honouring individual capabilities but there are no guarantees.\nOnly changed capabilities need to be included, all other capabilities keep their values.", + "description": "The event indicates that one or more capabilities have changed.\nSince the capabilities are dependent on the client and its UI, it might not be possible to change that at random times (or too late).\nConsequently this event has a hint characteristic: a client can only be expected to make a 'best effort' in honoring individual capabilities but there are no guarantees.\nOnly changed capabilities need to be included, all other capabilities keep their values.", "properties": { "event": { "type": "string", @@ -549,7 +568,7 @@ "ProgressStartEvent": { "allOf": [ { "$ref": "#/definitions/Event" }, { "type": "object", - "description": "The event signals that a long running operation is about to start and\nprovides additional information for the client to set up a corresponding progress and cancellation UI.\nThe client is free to delay the showing of the UI in order to reduce flicker.\nThis event should only be sent if the client has passed the value true for the 'supportsProgressReporting' capability of the 'initialize' request.", + "description": "The event signals that a long running operation is about to start and provides additional information for the client to set up a corresponding progress and cancellation UI.\nThe client is free to delay the showing of the UI in order to reduce flicker.\nThis event should only be sent if the corresponding capability `supportsProgressReporting` is true.", "properties": { "event": { "type": "string", @@ -560,27 +579,27 @@ "properties": { "progressId": { "type": "string", - "description": "An ID that must be used in subsequent 'progressUpdate' and 'progressEnd' events to make them refer to the same progress reporting.\nIDs must be unique within a debug session." + "description": "An ID that can be used in subsequent `progressUpdate` and `progressEnd` events to make them refer to the same progress reporting.\nIDs must be unique within a debug session." }, "title": { "type": "string", - "description": "Mandatory (short) title of the progress reporting. Shown in the UI to describe the long running operation." + "description": "Short title of the progress reporting. Shown in the UI to describe the long running operation." }, "requestId": { "type": "integer", - "description": "The request ID that this progress report is related to. If specified a debug adapter is expected to emit\nprogress events for the long running request until the request has been either completed or cancelled.\nIf the request ID is omitted, the progress report is assumed to be related to some general activity of the debug adapter." + "description": "The request ID that this progress report is related to. If specified a debug adapter is expected to emit progress events for the long running request until the request has been either completed or cancelled.\nIf the request ID is omitted, the progress report is assumed to be related to some general activity of the debug adapter." }, "cancellable": { "type": "boolean", - "description": "If true, the request that reports progress may be canceled with a 'cancel' request.\nSo this property basically controls whether the client should use UX that supports cancellation.\nClients that don't support cancellation are allowed to ignore the setting." + "description": "If true, the request that reports progress may be cancelled with a `cancel` request.\nSo this property basically controls whether the client should use UX that supports cancellation.\nClients that don't support cancellation are allowed to ignore the setting." }, "message": { "type": "string", - "description": "Optional, more detailed progress message." + "description": "More detailed progress message." }, "percentage": { "type": "number", - "description": "Optional progress percentage to display (value range: 0 to 100). If omitted no percentage will be shown." + "description": "Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown." } }, "required": [ "progressId", "title" ] @@ -593,7 +612,7 @@ "ProgressUpdateEvent": { "allOf": [ { "$ref": "#/definitions/Event" }, { "type": "object", - "description": "The event signals that the progress reporting needs to updated with a new message and/or percentage.\nThe client does not have to update the UI immediately, but the clients needs to keep track of the message and/or percentage values.\nThis event should only be sent if the client has passed the value true for the 'supportsProgressReporting' capability of the 'initialize' request.", + "description": "The event signals that the progress reporting needs to be updated with a new message and/or percentage.\nThe client does not have to update the UI immediately, but the clients needs to keep track of the message and/or percentage values.\nThis event should only be sent if the corresponding capability `supportsProgressReporting` is true.", "properties": { "event": { "type": "string", @@ -604,15 +623,15 @@ "properties": { "progressId": { "type": "string", - "description": "The ID that was introduced in the initial 'progressStart' event." + "description": "The ID that was introduced in the initial `progressStart` event." }, "message": { "type": "string", - "description": "Optional, more detailed progress message. If omitted, the previous message (if any) is used." + "description": "More detailed progress message. If omitted, the previous message (if any) is used." }, "percentage": { "type": "number", - "description": "Optional progress percentage to display (value range: 0 to 100). If omitted no percentage will be shown." + "description": "Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown." } }, "required": [ "progressId" ] @@ -625,7 +644,7 @@ "ProgressEndEvent": { "allOf": [ { "$ref": "#/definitions/Event" }, { "type": "object", - "description": "The event signals the end of the progress reporting with an optional final message.\nThis event should only be sent if the client has passed the value true for the 'supportsProgressReporting' capability of the 'initialize' request.", + "description": "The event signals the end of the progress reporting with a final message.\nThis event should only be sent if the corresponding capability `supportsProgressReporting` is true.", "properties": { "event": { "type": "string", @@ -636,11 +655,11 @@ "properties": { "progressId": { "type": "string", - "description": "The ID that was introduced in the initial 'ProgressStartEvent'." + "description": "The ID that was introduced in the initial `ProgressStartEvent`." }, "message": { "type": "string", - "description": "Optional, more detailed progress message. If omitted, the previous message (if any) is used." + "description": "More detailed progress message. If omitted, the previous message (if any) is used." } }, "required": [ "progressId" ] @@ -653,7 +672,7 @@ "InvalidatedEvent": { "allOf": [ { "$ref": "#/definitions/Event" }, { "type": "object", - "description": "This event signals that some state in the debug adapter has changed and requires that the client needs to re-render the data snapshot previously requested.\nDebug adapters do not have to emit this event for runtime changes like stopped or thread events because in that case the client refetches the new state anyway. But the event can be used for example to refresh the UI after rendering formatting has changed in the debug adapter.\nThis event should only be sent if the debug adapter has received a value true for the 'supportsInvalidatedEvent' capability of the 'initialize' request.", + "description": "This event signals that some state in the debug adapter has changed and requires that the client needs to re-render the data snapshot previously requested.\nDebug adapters do not have to emit this event for runtime changes like stopped or thread events because in that case the client refetches the new state anyway. But the event can be used for example to refresh the UI after rendering formatting has changed in the debug adapter.\nThis event should only be sent if the corresponding capability `supportsInvalidatedEvent` is true.", "properties": { "event": { "type": "string", @@ -664,7 +683,7 @@ "properties": { "areas": { "type": "array", - "description": "Optional set of logical areas that got invalidated. This property has a hint characteristic: a client can only be expected to make a 'best effort' in honouring the areas but there are no guarantees. If this property is missing, empty, or if values are not understand the client should assume a single value 'all'.", + "description": "Set of logical areas that got invalidated. This property has a hint characteristic: a client can only be expected to make a 'best effort' in honoring the areas but there are no guarantees. If this property is missing, empty, or if values are not understood, the client should assume a single value `all`.", "items": { "$ref": "#/definitions/InvalidatedAreas" } @@ -675,7 +694,7 @@ }, "stackFrameId": { "type": "integer", - "description": "If specified, the client only needs to refetch data related to this stack frame (and the 'threadId' is ignored)." + "description": "If specified, the client only needs to refetch data related to this stack frame (and the `threadId` is ignored)." } } } @@ -684,11 +703,43 @@ }] }, + "MemoryEvent": { + "allOf": [ { "$ref": "#/definitions/Event" }, { + "type": "object", + "description": "This event indicates that some memory range has been updated. It should only be sent if the corresponding capability `supportsMemoryEvent` is true.\nClients typically react to the event by re-issuing a `readMemory` request if they show the memory identified by the `memoryReference` and if the updated memory range overlaps the displayed range. Clients should not make assumptions how individual memory references relate to each other, so they should not assume that they are part of a single continuous address range and might overlap.\nDebug adapters can use this event to indicate that the contents of a memory range has changed due to some other request like `setVariable` or `setExpression`. Debug adapters are not expected to emit this event for each and every memory change of a running program, because that information is typically not available from debuggers and it would flood clients with too many events.", + "properties": { + "event": { + "type": "string", + "enum": [ "memory" ] + }, + "body": { + "type": "object", + "properties": { + "memoryReference": { + "type": "string", + "description": "Memory reference of a memory range that has been updated." + }, + "offset": { + "type": "integer", + "description": "Starting offset in bytes where memory has been updated. Can be negative." + }, + "count": { + "type": "integer", + "description": "Number of bytes updated." + } + }, + "required": [ "memoryReference", "offset", "count" ] + } + }, + "required": [ "event", "body" ] + }] + }, + "RunInTerminalRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", "title": "Reverse Requests", - "description": "This optional request is sent from the debug adapter to the client to run a command in a terminal.\nThis is typically used to launch the debuggee in a terminal provided by the client.\nThis request should only be called if the client has passed the value true for the 'supportsRunInTerminalRequest' capability of the 'initialize' request.", + "description": "This request is sent from the debug adapter to the client to run a command in a terminal.\nThis is typically used to launch the debuggee in a terminal provided by the client.\nThis request should only be called if the corresponding client capability `supportsRunInTerminalRequest` is true.\nClient implementations of `runInTerminal` are free to run the command however they choose including issuing the command to a command line interpreter (aka 'shell'). Argument strings passed to the `runInTerminal` request must arrive verbatim in the command to be run. As a consequence, clients which use a shell are responsible for escaping any special shell characters in the argument strings to prevent them from being interpreted (and modified) by the shell.\nSome users may wish to take advantage of shell processing in the argument strings. For clients which implement `runInTerminal` using an intermediary shell, the `argsCanBeInterpretedByShell` property can be set to true. In this case the client is requested not to escape any special shell characters in the argument strings.", "properties": { "command": { "type": "string", @@ -703,16 +754,16 @@ }, "RunInTerminalRequestArguments": { "type": "object", - "description": "Arguments for 'runInTerminal' request.", + "description": "Arguments for `runInTerminal` request.", "properties": { "kind": { "type": "string", "enum": [ "integrated", "external" ], - "description": "What kind of terminal to launch." + "description": "What kind of terminal to launch. Defaults to `integrated` if not specified." }, "title": { "type": "string", - "description": "Optional title of the terminal." + "description": "Title of the terminal." }, "cwd": { "type": "string", @@ -730,8 +781,12 @@ "description": "Environment key-value pairs that are added to or removed from the default environment.", "additionalProperties": { "type": [ "string", "null" ], - "description": "Proper values must be strings. A value of 'null' removes the variable from the environment." + "description": "A string is a proper value for an environment variable. The value `null` removes the variable from the environment." } + }, + "argsCanBeInterpretedByShell": { + "type": "boolean", + "description": "This property should only be set if the corresponding capability `supportsArgsCanBeInterpretedByShell` is true. If the client uses an intermediary shell to launch the application, then the client must not attempt to escape characters with special meanings for the shell. The user is fully responsible for escaping as needed and that arguments using special characters may not be portable across shells." } }, "required": [ "args", "cwd" ] @@ -739,7 +794,7 @@ "RunInTerminalResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'runInTerminal' request.", + "description": "Response to `runInTerminal` request.", "properties": { "body": { "type": "object", @@ -758,12 +813,72 @@ "required": [ "body" ] }] }, + "StartDebuggingRequest": { + "allOf": [ + { + "$ref": "#/definitions/Request" + }, + { + "type": "object", + "description": "This request is sent from the debug adapter to the client to start a new debug session of the same type as the caller.\nThis request should only be sent if the corresponding client capability `supportsStartDebuggingRequest` is true.\nA client implementation of `startDebugging` should start a new debug session (of the same type as the caller) in the same way that the caller's session was started. If the client supports hierarchical debug sessions, the newly created session can be treated as a child of the caller session.", + "properties": { + "command": { + "type": "string", + "enum": [ + "startDebugging" + ] + }, + "arguments": { + "$ref": "#/definitions/StartDebuggingRequestArguments" + } + }, + "required": [ + "command", + "arguments" + ] + } + ] + }, + "StartDebuggingRequestArguments": { + "type": "object", + "description": "Arguments for `startDebugging` request.", + "properties": { + "configuration": { + "type": "object", + "additionalProperties": true, + "description": "Arguments passed to the new debug session. The arguments must only contain properties understood by the `launch` or `attach` requests of the debug adapter and they must not contain any client-specific properties (e.g. `type`) or client-specific features (e.g. substitutable 'variables')." + }, + "request": { + "type": "string", + "enum": [ + "launch", + "attach" + ], + "description": "Indicates whether the new debug session should be started with a `launch` or `attach` request." + } + }, + "required": [ + "configuration", + "request" + ] + }, + "StartDebuggingResponse": { + "allOf": [ + { + "$ref": "#/definitions/Response" + }, + { + "type": "object", + "description": "Response to `startDebugging` request. This is just an acknowledgement, so no body field is required." + } + ] + }, "InitializeRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", "title": "Requests", - "description": "The 'initialize' request is sent as the first request from the client to the debug adapter\nin order to configure it with client capabilities and to retrieve capabilities from the debug adapter.\nUntil the debug adapter has responded to with an 'initialize' response, the client must not send any additional requests or events to the debug adapter.\nIn addition the debug adapter is not allowed to send any requests or events to the client until it has responded with an 'initialize' response.\nThe 'initialize' request may only be sent once.", + "description": "The `initialize` request is sent as the first request from the client to the debug adapter in order to configure it with client capabilities and to retrieve capabilities from the debug adapter.\nUntil the debug adapter has responded with an `initialize` response, the client must not send any additional requests or events to the debug adapter.\nIn addition the debug adapter is not allowed to send any requests or events to the client until it has responded with an `initialize` response.\nThe `initialize` request may only be sent once.", "properties": { "command": { "type": "string", @@ -778,15 +893,15 @@ }, "InitializeRequestArguments": { "type": "object", - "description": "Arguments for 'initialize' request.", + "description": "Arguments for `initialize` request.", "properties": { "clientID": { "type": "string", - "description": "The ID of the (frontend) client using this adapter." + "description": "The ID of the client using this adapter." }, "clientName": { "type": "string", - "description": "The human readable name of the (frontend) client using this adapter." + "description": "The human-readable name of the client using this adapter." }, "adapterID": { "type": "string", @@ -794,7 +909,7 @@ }, "locale": { "type": "string", - "description": "The ISO-639 locale of the (frontend) client using this adapter, e.g. en-US or de-CH." + "description": "The ISO-639 locale of the client using this adapter, e.g. en-US or de-CH." }, "linesStartAt1": { "type": "boolean", @@ -807,11 +922,11 @@ "pathFormat": { "type": "string", "_enum": [ "path", "uri" ], - "description": "Determines in what format paths are specified. The default is 'path', which is the native format." + "description": "Determines in what format paths are specified. The default is `path`, which is the native format." }, "supportsVariableType": { "type": "boolean", - "description": "Client supports the optional type attribute for variables." + "description": "Client supports the `type` attribute for variables." }, "supportsVariablePaging": { "type": "boolean", @@ -819,7 +934,7 @@ }, "supportsRunInTerminalRequest": { "type": "boolean", - "description": "Client supports the runInTerminal request." + "description": "Client supports the `runInTerminal` request." }, "supportsMemoryReferences": { "type": "boolean", @@ -831,7 +946,23 @@ }, "supportsInvalidatedEvent": { "type": "boolean", - "description": "Client supports the invalidated event." + "description": "Client supports the `invalidated` event." + }, + "supportsMemoryEvent": { + "type": "boolean", + "description": "Client supports the `memory` event." + }, + "supportsArgsCanBeInterpretedByShell": { + "type": "boolean", + "description": "Client supports the `argsCanBeInterpretedByShell` attribute on the `runInTerminal` request." + }, + "supportsStartDebuggingRequest": { + "type": "boolean", + "description": "Client supports the `startDebugging` request." + }, + "supportsANSIStyling": { + "type": "boolean", + "description": "The client will interpret ANSI escape sequences in the display of `OutputEvent.output` and `Variable.value` fields when `Capabilities.supportsANSIStyling` is also enabled." } }, "required": [ "adapterID" ] @@ -839,7 +970,7 @@ "InitializeResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'initialize' request.", + "description": "Response to `initialize` request.", "properties": { "body": { "$ref": "#/definitions/Capabilities", @@ -852,7 +983,7 @@ "ConfigurationDoneRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "This optional request indicates that the client has finished initialization of the debug adapter.\nSo it is the last request in the sequence of configuration requests (which was started by the 'initialized' event).\nClients should only call this request if the capability 'supportsConfigurationDoneRequest' is true.", + "description": "This request indicates that the client has finished initialization of the debug adapter.\nSo it is the last request in the sequence of configuration requests (which was started by the `initialized` event).\nClients should only call this request if the corresponding capability `supportsConfigurationDoneRequest` is true.", "properties": { "command": { "type": "string", @@ -867,19 +998,19 @@ }, "ConfigurationDoneArguments": { "type": "object", - "description": "Arguments for 'configurationDone' request." + "description": "Arguments for `configurationDone` request." }, "ConfigurationDoneResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'configurationDone' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `configurationDone` request. This is just an acknowledgement, so no body field is required." }] }, "LaunchRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "This launch request is sent from the client to the debug adapter to start the debuggee with or without debugging (if 'noDebug' is true).\nSince launching is debugger/runtime specific, the arguments for this request are not part of this specification.", + "description": "This launch request is sent from the client to the debug adapter to start the debuggee with or without debugging (if `noDebug` is true).\nSince launching is debugger/runtime specific, the arguments for this request are not part of this specification.", "properties": { "command": { "type": "string", @@ -894,29 +1025,29 @@ }, "LaunchRequestArguments": { "type": "object", - "description": "Arguments for 'launch' request. Additional attributes are implementation specific.", + "description": "Arguments for `launch` request. Additional attributes are implementation specific.", "properties": { "noDebug": { "type": "boolean", - "description": "If noDebug is true the launch request should launch the program without enabling debugging." + "description": "If true, the launch request should launch the program without enabling debugging." }, "__restart": { "type": [ "array", "boolean", "integer", "null", "number", "object", "string" ], - "description": "Optional data from the previous, restarted session.\nThe data is sent as the 'restart' attribute of the 'terminated' event.\nThe client should leave the data intact." + "description": "Arbitrary data from the previous, restarted session.\nThe data is sent as the `restart` attribute of the `terminated` event.\nThe client should leave the data intact." } } }, "LaunchResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'launch' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `launch` request. This is just an acknowledgement, so no body field is required." }] }, "AttachRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The attach request is sent from the client to the debug adapter to attach to a debuggee that is already running.\nSince attaching is debugger/runtime specific, the arguments for this request are not part of this specification.", + "description": "The `attach` request is sent from the client to the debug adapter to attach to a debuggee that is already running.\nSince attaching is debugger/runtime specific, the arguments for this request are not part of this specification.", "properties": { "command": { "type": "string", @@ -931,25 +1062,25 @@ }, "AttachRequestArguments": { "type": "object", - "description": "Arguments for 'attach' request. Additional attributes are implementation specific.", + "description": "Arguments for `attach` request. Additional attributes are implementation specific.", "properties": { "__restart": { "type": [ "array", "boolean", "integer", "null", "number", "object", "string" ], - "description": "Optional data from the previous, restarted session.\nThe data is sent as the 'restart' attribute of the 'terminated' event.\nThe client should leave the data intact." + "description": "Arbitrary data from the previous, restarted session.\nThe data is sent as the `restart` attribute of the `terminated` event.\nThe client should leave the data intact." } } }, "AttachResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'attach' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `attach` request. This is just an acknowledgement, so no body field is required." }] }, "RestartRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Restarts a debug session. Clients should only call this request if the capability 'supportsRestartRequest' is true.\nIf the capability is missing or has the value false, a typical client will emulate 'restart' by terminating the debug adapter first and then launching it anew.", + "description": "Restarts a debug session. Clients should only call this request if the corresponding capability `supportsRestartRequest` is true.\nIf the capability is missing or has the value false, a typical client emulates `restart` by terminating the debug adapter first and then launching it anew.", "properties": { "command": { "type": "string", @@ -964,19 +1095,28 @@ }, "RestartArguments": { "type": "object", - "description": "Arguments for 'restart' request." + "description": "Arguments for `restart` request.", + "properties": { + "arguments": { + "oneOf": [ + { "$ref": "#/definitions/LaunchRequestArguments" }, + { "$ref": "#/definitions/AttachRequestArguments" } + ], + "description": "The latest version of the `launch` or `attach` configuration." + } + } }, "RestartResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'restart' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `restart` request. This is just an acknowledgement, so no body field is required." }] }, "DisconnectRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The 'disconnect' request is sent from the client to the debug adapter in order to stop debugging.\nIt asks the debug adapter to disconnect from the debuggee and to terminate the debug adapter.\nIf the debuggee has been started with the 'launch' request, the 'disconnect' request terminates the debuggee.\nIf the 'attach' request was used to connect to the debuggee, 'disconnect' does not terminate the debuggee.\nThis behavior can be controlled with the 'terminateDebuggee' argument (if supported by the debug adapter).", + "description": "The `disconnect` request asks the debug adapter to disconnect from the debuggee (thus ending the debug session) and then to shut down itself (the debug adapter).\nIn addition, the debug adapter must terminate the debuggee if it was started with the `launch` request. If an `attach` request was used to connect to the debuggee, then the debug adapter must not terminate the debuggee.\nThis implicit behavior of when to terminate the debuggee can be overridden with the `terminateDebuggee` argument (which is only supported by a debug adapter if the corresponding capability `supportTerminateDebuggee` is true).", "properties": { "command": { "type": "string", @@ -991,29 +1131,33 @@ }, "DisconnectArguments": { "type": "object", - "description": "Arguments for 'disconnect' request.", + "description": "Arguments for `disconnect` request.", "properties": { "restart": { "type": "boolean", - "description": "A value of true indicates that this 'disconnect' request is part of a restart sequence." + "description": "A value of true indicates that this `disconnect` request is part of a restart sequence." }, "terminateDebuggee": { "type": "boolean", - "description": "Indicates whether the debuggee should be terminated when the debugger is disconnected.\nIf unspecified, the debug adapter is free to do whatever it thinks is best.\nThe attribute is only honored by a debug adapter if the capability 'supportTerminateDebuggee' is true." + "description": "Indicates whether the debuggee should be terminated when the debugger is disconnected.\nIf unspecified, the debug adapter is free to do whatever it thinks is best.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportTerminateDebuggee` is true." + }, + "suspendDebuggee": { + "type": "boolean", + "description": "Indicates whether the debuggee should stay suspended when the debugger is disconnected.\nIf unspecified, the debuggee should resume execution.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportSuspendDebuggee` is true." } } }, "DisconnectResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'disconnect' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `disconnect` request. This is just an acknowledgement, so no body field is required." }] }, "TerminateRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The 'terminate' request is sent from the client to the debug adapter in order to give the debuggee a chance for terminating itself.\nClients should only call this request if the capability 'supportsTerminateRequest' is true.", + "description": "The `terminate` request is sent from the client to the debug adapter in order to shut down the debuggee gracefully. Clients should only call this request if the capability `supportsTerminateRequest` is true.\nTypically a debug adapter implements `terminate` by sending a software signal which the debuggee intercepts in order to clean things up properly before terminating itself.\nPlease note that this request does not directly affect the state of the debug session: if the debuggee decides to veto the graceful shutdown for any reason by not terminating itself, then the debug session just continues.\nClients can surface the `terminate` request as an explicit command or they can integrate it into a two stage Stop command that first sends `terminate` to request a graceful shutdown, and if that fails uses `disconnect` for a forceful shutdown.", "properties": { "command": { "type": "string", @@ -1028,25 +1172,25 @@ }, "TerminateArguments": { "type": "object", - "description": "Arguments for 'terminate' request.", + "description": "Arguments for `terminate` request.", "properties": { "restart": { "type": "boolean", - "description": "A value of true indicates that this 'terminate' request is part of a restart sequence." + "description": "A value of true indicates that this `terminate` request is part of a restart sequence." } } }, "TerminateResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'terminate' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `terminate` request. This is just an acknowledgement, so no body field is required." }] }, "BreakpointLocationsRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The 'breakpointLocations' request returns all possible locations for source breakpoints in a given range.\nClients should only call this request if the capability 'supportsBreakpointLocationsRequest' is true.", + "description": "The `breakpointLocations` request returns all possible locations for source breakpoints in a given range.\nClients should only call this request if the corresponding capability `supportsBreakpointLocationsRequest` is true.", "properties": { "command": { "type": "string", @@ -1062,11 +1206,11 @@ }, "BreakpointLocationsArguments": { "type": "object", - "description": "Arguments for 'breakpointLocations' request.", + "description": "Arguments for `breakpointLocations` request.", "properties": { "source": { "$ref": "#/definitions/Source", - "description": "The source location of the breakpoints; either 'source.path' or 'source.reference' must be specified." + "description": "The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified." }, "line": { "type": "integer", @@ -1074,15 +1218,15 @@ }, "column": { "type": "integer", - "description": "Optional start column of range to search possible breakpoint locations in. If no start column is given, the first column in the start line is assumed." + "description": "Start position within `line` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed." }, "endLine": { "type": "integer", - "description": "Optional end line of range to search possible breakpoint locations in. If no end line is given, then the end line is assumed to be the start line." + "description": "End line of range to search possible breakpoint locations in. If no end line is given, then the end line is assumed to be the start line." }, "endColumn": { "type": "integer", - "description": "Optional end column of range to search possible breakpoint locations in. If no end column is given, then it is assumed to be in the last column of the end line." + "description": "End position within `endLine` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no end column is given, the last position in the end line is assumed." } }, "required": [ "source", "line" ] @@ -1090,7 +1234,7 @@ "BreakpointLocationsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'breakpointLocations' request.\nContains possible locations for source breakpoints.", + "description": "Response to `breakpointLocations` request.\nContains possible locations for source breakpoints.", "properties": { "body": { "type": "object", @@ -1113,7 +1257,7 @@ "SetBreakpointsRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Sets multiple breakpoints for a single source and clears all previous breakpoints in that source.\nTo clear all breakpoint for a source, specify an empty array.\nWhen a breakpoint is hit, a 'stopped' event (with reason 'breakpoint') is generated.", + "description": "Sets multiple breakpoints for a single source and clears all previous breakpoints in that source.\nTo clear all breakpoint for a source, specify an empty array.\nWhen a breakpoint is hit, a `stopped` event (with reason `breakpoint`) is generated.", "properties": { "command": { "type": "string", @@ -1128,11 +1272,11 @@ }, "SetBreakpointsArguments": { "type": "object", - "description": "Arguments for 'setBreakpoints' request.", + "description": "Arguments for `setBreakpoints` request.", "properties": { "source": { "$ref": "#/definitions/Source", - "description": "The source location of the breakpoints; either 'source.path' or 'source.reference' must be specified." + "description": "The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified." }, "breakpoints": { "type": "array", @@ -1158,7 +1302,7 @@ "SetBreakpointsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'setBreakpoints' request.\nReturned is information about each breakpoint created by this request.\nThis includes the actual code location and whether the breakpoint could be verified.\nThe breakpoints returned are in the same order as the elements of the 'breakpoints'\n(or the deprecated 'lines') array in the arguments.", + "description": "Response to `setBreakpoints` request.\nReturned is information about each breakpoint created by this request.\nThis includes the actual code location and whether the breakpoint could be verified.\nThe breakpoints returned are in the same order as the elements of the `breakpoints`\n(or the deprecated `lines`) array in the arguments.", "properties": { "body": { "type": "object", @@ -1168,7 +1312,7 @@ "items": { "$ref": "#/definitions/Breakpoint" }, - "description": "Information about the breakpoints.\nThe array elements are in the same order as the elements of the 'breakpoints' (or the deprecated 'lines') array in the arguments." + "description": "Information about the breakpoints.\nThe array elements are in the same order as the elements of the `breakpoints` (or the deprecated `lines`) array in the arguments." } }, "required": [ "breakpoints" ] @@ -1181,7 +1325,7 @@ "SetFunctionBreakpointsRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Replaces all existing function breakpoints with new function breakpoints.\nTo clear all function breakpoints, specify an empty array.\nWhen a function breakpoint is hit, a 'stopped' event (with reason 'function breakpoint') is generated.\nClients should only call this request if the capability 'supportsFunctionBreakpoints' is true.", + "description": "Replaces all existing function breakpoints with new function breakpoints.\nTo clear all function breakpoints, specify an empty array.\nWhen a function breakpoint is hit, a `stopped` event (with reason `function breakpoint`) is generated.\nClients should only call this request if the corresponding capability `supportsFunctionBreakpoints` is true.", "properties": { "command": { "type": "string", @@ -1196,7 +1340,7 @@ }, "SetFunctionBreakpointsArguments": { "type": "object", - "description": "Arguments for 'setFunctionBreakpoints' request.", + "description": "Arguments for `setFunctionBreakpoints` request.", "properties": { "breakpoints": { "type": "array", @@ -1211,7 +1355,7 @@ "SetFunctionBreakpointsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'setFunctionBreakpoints' request.\nReturned is information about each breakpoint created by this request.", + "description": "Response to `setFunctionBreakpoints` request.\nReturned is information about each breakpoint created by this request.", "properties": { "body": { "type": "object", @@ -1221,7 +1365,7 @@ "items": { "$ref": "#/definitions/Breakpoint" }, - "description": "Information about the breakpoints. The array elements correspond to the elements of the 'breakpoints' array." + "description": "Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array." } }, "required": [ "breakpoints" ] @@ -1234,7 +1378,7 @@ "SetExceptionBreakpointsRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request configures the debuggers response to thrown exceptions.\nIf an exception is configured to break, a 'stopped' event is fired (with reason 'exception').\nClients should only call this request if the capability 'exceptionBreakpointFilters' returns one or more filters.", + "description": "The request configures the debugger's response to thrown exceptions. Each of the `filters`, `filterOptions`, and `exceptionOptions` in the request are independent configurations to a debug adapter indicating a kind of exception to catch. An exception thrown in a program should result in a `stopped` event from the debug adapter (with reason `exception`) if any of the configured filters match.\nClients should only call this request if the corresponding capability `exceptionBreakpointFilters` returns one or more filters.", "properties": { "command": { "type": "string", @@ -1249,28 +1393,28 @@ }, "SetExceptionBreakpointsArguments": { "type": "object", - "description": "Arguments for 'setExceptionBreakpoints' request.", + "description": "Arguments for `setExceptionBreakpoints` request.", "properties": { "filters": { "type": "array", "items": { "type": "string" }, - "description": "Set of exception filters specified by their ID. The set of all possible exception filters is defined by the 'exceptionBreakpointFilters' capability. The 'filter' and 'filterOptions' sets are additive." + "description": "Set of exception filters specified by their ID. The set of all possible exception filters is defined by the `exceptionBreakpointFilters` capability. The `filter` and `filterOptions` sets are additive." }, "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. The 'filter' and 'filterOptions' sets are additive." + "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 corresponding capability `supportsExceptionFilterOptions` is true. The `filter` and `filterOptions` sets are additive." }, "exceptionOptions": { "type": "array", "items": { "$ref": "#/definitions/ExceptionOptions" }, - "description": "Configuration options for selected exceptions.\nThe attribute is only honored by a debug adapter if the capability 'supportsExceptionOptions' is true." + "description": "Configuration options for selected exceptions.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsExceptionOptions` is true." } }, "required": [ "filters" ] @@ -1278,14 +1422,28 @@ "SetExceptionBreakpointsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'setExceptionBreakpoints' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `setExceptionBreakpoints` request.\nThe response contains an array of `Breakpoint` objects with information about each exception breakpoint or filter. The `Breakpoint` objects are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays given as arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information.\nThe `verified` property of a `Breakpoint` object signals whether the exception breakpoint or filter could be successfully created and whether the condition is valid. In case of an error the `message` property explains the problem. The `id` property can be used to introduce a unique ID for the exception breakpoint or filter so that it can be updated subsequently by sending breakpoint events.\nFor backward compatibility both the `breakpoints` array and the enclosing `body` are optional. If these elements are missing a client is not able to show problems for individual exception breakpoints or filters.", + "properties": { + "body": { + "type": "object", + "properties": { + "breakpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/Breakpoint" + }, + "description": "Information about the exception breakpoints or filters.\nThe breakpoints returned are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays in the arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information." + } + } + } + } }] }, "DataBreakpointInfoRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Obtains information on a possible data breakpoint that could be set on an expression or variable.\nClients should only call this request if the capability 'supportsDataBreakpoints' is true.", + "description": "Obtains information on a possible data breakpoint that could be set on an expression or variable.\nClients should only call this request if the corresponding capability `supportsDataBreakpoints` is true.", "properties": { "command": { "type": "string", @@ -1300,15 +1458,31 @@ }, "DataBreakpointInfoArguments": { "type": "object", - "description": "Arguments for 'dataBreakpointInfo' request.", + "description": "Arguments for `dataBreakpointInfo` request.", "properties": { "variablesReference": { "type": "integer", - "description": "Reference to the Variable container if the data breakpoint is requested for a child of the container." + "description": "Reference to the variable container if the data breakpoint is requested for a child of the container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details." }, "name": { "type": "string", - "description": "The name of the Variable's child to obtain data breakpoint information for.\nIf variablesReference isn’t provided, this can be an expression." + "description": "The name of the variable's child to obtain data breakpoint information for.\nIf `variablesReference` isn't specified, this can be an expression, or an address if `asAddress` is also true." + }, + "frameId": { + "type": "integer", + "description": "When `name` is an expression, evaluate it in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. When `variablesReference` is specified, this property has no effect." + }, + "bytes": { + "type": "integer", + "description": "If specified, a debug adapter should return information for the range of memory extending `bytes` number of bytes from the address or variable specified by `name`. Breakpoints set using the resulting data ID should pause on data access anywhere within that range.\n\nClients may set this property only if the `supportsDataBreakpointBytes` capability is true." + }, + "asAddress": { + "type": "boolean", + "description": "If `true`, the `name` is a memory address and the debugger should interpret it as a decimal value, or hex value if it is prefixed with `0x`.\n\nClients may set this property only if the `supportsDataBreakpointBytes`\ncapability is true." + }, + "mode": { + "type": "string", + "description": "The mode of the desired breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`." } }, "required": [ "name" ] @@ -1316,14 +1490,14 @@ "DataBreakpointInfoResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'dataBreakpointInfo' request.", + "description": "Response to `dataBreakpointInfo` request.", "properties": { "body": { "type": "object", "properties": { "dataId": { "type": [ "string", "null" ], - "description": "An identifier for the data on which a data breakpoint can be registered with the setDataBreakpoints request or null if no data breakpoint is available." + "description": "An identifier for the data on which a data breakpoint can be registered with the `setDataBreakpoints` request or null if no data breakpoint is available. If a `variablesReference` or `frameId` is passed, the `dataId` is valid in the current suspended state, otherwise it's valid indefinitely. See 'Lifetime of Object References' in the Overview section for details. Breakpoints set using the `dataId` in the `setDataBreakpoints` request may outlive the lifetime of the associated `dataId`." }, "description": { "type": "string", @@ -1334,11 +1508,11 @@ "items": { "$ref": "#/definitions/DataBreakpointAccessType" }, - "description": "Optional attribute listing the available access types for a potential data breakpoint. A UI frontend could surface this information." + "description": "Attribute lists the available access types for a potential data breakpoint. A UI client could surface this information." }, "canPersist": { "type": "boolean", - "description": "Optional attribute indicating that a potential data breakpoint could be persisted across sessions." + "description": "Attribute indicates that a potential data breakpoint could be persisted across sessions." } }, "required": [ "dataId", "description" ] @@ -1351,7 +1525,7 @@ "SetDataBreakpointsRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Replaces all existing data breakpoints with new data breakpoints.\nTo clear all data breakpoints, specify an empty array.\nWhen a data breakpoint is hit, a 'stopped' event (with reason 'data breakpoint') is generated.\nClients should only call this request if the capability 'supportsDataBreakpoints' is true.", + "description": "Replaces all existing data breakpoints with new data breakpoints.\nTo clear all data breakpoints, specify an empty array.\nWhen a data breakpoint is hit, a `stopped` event (with reason `data breakpoint`) is generated.\nClients should only call this request if the corresponding capability `supportsDataBreakpoints` is true.", "properties": { "command": { "type": "string", @@ -1366,7 +1540,7 @@ }, "SetDataBreakpointsArguments": { "type": "object", - "description": "Arguments for 'setDataBreakpoints' request.", + "description": "Arguments for `setDataBreakpoints` request.", "properties": { "breakpoints": { "type": "array", @@ -1381,7 +1555,7 @@ "SetDataBreakpointsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'setDataBreakpoints' request.\nReturned is information about each breakpoint created by this request.", + "description": "Response to `setDataBreakpoints` request.\nReturned is information about each breakpoint created by this request.", "properties": { "body": { "type": "object", @@ -1391,7 +1565,7 @@ "items": { "$ref": "#/definitions/Breakpoint" }, - "description": "Information about the data breakpoints. The array elements correspond to the elements of the input argument 'breakpoints' array." + "description": "Information about the data breakpoints. The array elements correspond to the elements of the input argument `breakpoints` array." } }, "required": [ "breakpoints" ] @@ -1406,7 +1580,7 @@ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Replaces all existing instruction breakpoints. Typically, instruction breakpoints would be set from a diassembly window. \nTo clear all instruction breakpoints, specify an empty array.\nWhen an instruction breakpoint is hit, a 'stopped' event (with reason 'instruction breakpoint') is generated.\nClients should only call this request if the capability 'supportsInstructionBreakpoints' is true.", + "description": "Replaces all existing instruction breakpoints. Typically, instruction breakpoints would be set from a disassembly window. \nTo clear all instruction breakpoints, specify an empty array.\nWhen an instruction breakpoint is hit, a `stopped` event (with reason `instruction breakpoint`) is generated.\nClients should only call this request if the corresponding capability `supportsInstructionBreakpoints` is true.", "properties": { "command": { "type": "string", @@ -1421,7 +1595,7 @@ }, "SetInstructionBreakpointsArguments": { "type": "object", - "description": "Arguments for 'setInstructionBreakpoints' request", + "description": "Arguments for `setInstructionBreakpoints` request", "properties": { "breakpoints": { "type": "array", @@ -1438,7 +1612,7 @@ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'setInstructionBreakpoints' request", + "description": "Response to `setInstructionBreakpoints` request", "properties": { "body": { "type": "object", @@ -1448,7 +1622,7 @@ "items": { "$ref": "#/definitions/Breakpoint" }, - "description": "Information about the breakpoints. The array elements correspond to the elements of the 'breakpoints' array." + "description": "Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array." } }, "required": [ "breakpoints" ] @@ -1461,7 +1635,7 @@ "ContinueRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request starts the debuggee to run again.", + "description": "The request resumes execution of all threads. If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true resumes only the specified thread. If not all threads were resumed, the `allThreadsContinued` attribute of the response should be set to false.", "properties": { "command": { "type": "string", @@ -1476,11 +1650,15 @@ }, "ContinueArguments": { "type": "object", - "description": "Arguments for 'continue' request.", + "description": "Arguments for `continue` request.", "properties": { "threadId": { "type": "integer", - "description": "Continue execution for the specified thread (if possible).\nIf the backend cannot continue on a single thread but will continue on all threads, it should set the 'allThreadsContinued' attribute in the response to true." + "description": "Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the argument `singleThread` is true, only the thread with this ID is resumed." + }, + "singleThread": { + "type": "boolean", + "description": "If this flag is true, execution is resumed only for the thread with given `threadId`." } }, "required": [ "threadId" ] @@ -1488,14 +1666,14 @@ "ContinueResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'continue' request.", + "description": "Response to `continue` request.", "properties": { "body": { "type": "object", "properties": { "allThreadsContinued": { "type": "boolean", - "description": "If true, the 'continue' request has ignored the specified thread and continued all threads instead.\nIf this attribute is missing a value of 'true' is assumed for backward compatibility." + "description": "The value true (or a missing property) signals to the client that all threads have been resumed. The value false indicates that not all threads were resumed." } } } @@ -1507,7 +1685,7 @@ "NextRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request starts the debuggee to run again for one step.\nThe debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed.", + "description": "The request executes one step (in the given granularity) for the specified thread and allows all other threads to run freely by resuming them.\nIf the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.\nThe debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.", "properties": { "command": { "type": "string", @@ -1522,15 +1700,19 @@ }, "NextArguments": { "type": "object", - "description": "Arguments for 'next' request.", + "description": "Arguments for `next` request.", "properties": { "threadId": { "type": "integer", - "description": "Execute 'next' for this thread." + "description": "Specifies the thread for which to resume execution for one step (of the given granularity)." + }, + "singleThread": { + "type": "boolean", + "description": "If this flag is true, all other suspended threads are not resumed." }, "granularity": { "$ref": "#/definitions/SteppingGranularity", - "description": "Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed." + "description": "Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed." } }, "required": [ "threadId" ] @@ -1538,14 +1720,14 @@ "NextResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'next' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `next` request. This is just an acknowledgement, so no body field is required." }] }, "StepInRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request starts the debuggee to step into a function/method if possible.\nIf it cannot step into a target, 'stepIn' behaves like 'next'.\nThe debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed.\nIf there are multiple function/method calls (or other targets) on the source line,\nthe optional argument 'targetId' can be used to control into which target the 'stepIn' should occur.\nThe list of possible targets for a given source line can be retrieved via the 'stepInTargets' request.", + "description": "The request resumes the given thread to step into a function/method and allows all other threads to run freely by resuming them.\nIf the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.\nIf the request cannot step into a target, `stepIn` behaves like the `next` request.\nThe debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.\nIf there are multiple function/method calls (or other targets) on the source line,\nthe argument `targetId` can be used to control into which target the `stepIn` should occur.\nThe list of possible targets for a given source line can be retrieved via the `stepInTargets` request.", "properties": { "command": { "type": "string", @@ -1560,19 +1742,23 @@ }, "StepInArguments": { "type": "object", - "description": "Arguments for 'stepIn' request.", + "description": "Arguments for `stepIn` request.", "properties": { "threadId": { "type": "integer", - "description": "Execute 'stepIn' for this thread." + "description": "Specifies the thread for which to resume execution for one step-into (of the given granularity)." + }, + "singleThread": { + "type": "boolean", + "description": "If this flag is true, all other suspended threads are not resumed." }, "targetId": { "type": "integer", - "description": "Optional id of the target to step into." + "description": "Id of the target to step into." }, "granularity": { "$ref": "#/definitions/SteppingGranularity", - "description": "Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed." + "description": "Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed." } }, "required": [ "threadId" ] @@ -1580,14 +1766,14 @@ "StepInResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'stepIn' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `stepIn` request. This is just an acknowledgement, so no body field is required." }] }, "StepOutRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request starts the debuggee to run again for one step.\nThe debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed.", + "description": "The request resumes the given thread to step out (return) from a function/method and allows all other threads to run freely by resuming them.\nIf the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.\nThe debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.", "properties": { "command": { "type": "string", @@ -1602,15 +1788,19 @@ }, "StepOutArguments": { "type": "object", - "description": "Arguments for 'stepOut' request.", + "description": "Arguments for `stepOut` request.", "properties": { "threadId": { "type": "integer", - "description": "Execute 'stepOut' for this thread." + "description": "Specifies the thread for which to resume execution for one step-out (of the given granularity)." + }, + "singleThread": { + "type": "boolean", + "description": "If this flag is true, all other suspended threads are not resumed." }, "granularity": { "$ref": "#/definitions/SteppingGranularity", - "description": "Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed." + "description": "Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed." } }, "required": [ "threadId" ] @@ -1618,14 +1808,14 @@ "StepOutResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'stepOut' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `stepOut` request. This is just an acknowledgement, so no body field is required." }] }, "StepBackRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request starts the debuggee to run one step backwards.\nThe debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed.\nClients should only call this request if the capability 'supportsStepBack' is true.", + "description": "The request executes one backward step (in the given granularity) for the specified thread and allows all other threads to run backward freely by resuming them.\nIf the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.\nThe debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.\nClients should only call this request if the corresponding capability `supportsStepBack` is true.", "properties": { "command": { "type": "string", @@ -1640,15 +1830,19 @@ }, "StepBackArguments": { "type": "object", - "description": "Arguments for 'stepBack' request.", + "description": "Arguments for `stepBack` request.", "properties": { "threadId": { "type": "integer", - "description": "Execute 'stepBack' for this thread." + "description": "Specifies the thread for which to resume execution for one step backwards (of the given granularity)." + }, + "singleThread": { + "type": "boolean", + "description": "If this flag is true, all other suspended threads are not resumed." }, "granularity": { "$ref": "#/definitions/SteppingGranularity", - "description": "Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed." + "description": "Stepping granularity to step. If no granularity is specified, a granularity of `statement` is assumed." } }, "required": [ "threadId" ] @@ -1656,14 +1850,14 @@ "StepBackResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'stepBack' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `stepBack` request. This is just an acknowledgement, so no body field is required." }] }, "ReverseContinueRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request starts the debuggee to run backward.\nClients should only call this request if the capability 'supportsStepBack' is true.", + "description": "The request resumes backward execution of all threads. If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true resumes only the specified thread. If not all threads were resumed, the `allThreadsContinued` attribute of the response should be set to false.\nClients should only call this request if the corresponding capability `supportsStepBack` is true.", "properties": { "command": { "type": "string", @@ -1678,26 +1872,31 @@ }, "ReverseContinueArguments": { "type": "object", - "description": "Arguments for 'reverseContinue' request.", + "description": "Arguments for `reverseContinue` request.", "properties": { "threadId": { "type": "integer", - "description": "Execute 'reverseContinue' for this thread." + "description": "Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the `singleThread` argument is true, only the thread with this ID is resumed." + }, + "singleThread": { + "type": "boolean", + "description": "If this flag is true, backward execution is resumed only for the thread with given `threadId`." } + }, "required": [ "threadId" ] }, "ReverseContinueResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'reverseContinue' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `reverseContinue` request. This is just an acknowledgement, so no body field is required." }] }, "RestartFrameRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request restarts execution of the specified stackframe.\nThe debug adapter first sends the response and then a 'stopped' event (with reason 'restart') after the restart has completed.\nClients should only call this request if the capability 'supportsRestartFrame' is true.", + "description": "The request restarts execution of the specified stack frame.\nThe debug adapter first sends the response and then a `stopped` event (with reason `restart`) after the restart has completed.\nClients should only call this request if the corresponding capability `supportsRestartFrame` is true.", "properties": { "command": { "type": "string", @@ -1712,11 +1911,11 @@ }, "RestartFrameArguments": { "type": "object", - "description": "Arguments for 'restartFrame' request.", + "description": "Arguments for `restartFrame` request.", "properties": { "frameId": { "type": "integer", - "description": "Restart this stackframe." + "description": "Restart the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details." } }, "required": [ "frameId" ] @@ -1724,14 +1923,14 @@ "RestartFrameResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'restartFrame' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `restartFrame` request. This is just an acknowledgement, so no body field is required." }] }, "GotoRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request sets the location where the debuggee will continue to run.\nThis makes it possible to skip the execution of code or to executed code again.\nThe code between the current location and the goto target is not executed but skipped.\nThe debug adapter first sends the response and then a 'stopped' event with reason 'goto'.\nClients should only call this request if the capability 'supportsGotoTargetsRequest' is true (because only then goto targets exist that can be passed as arguments).", + "description": "The request sets the location where the debuggee will continue to run.\nThis makes it possible to skip the execution of code or to execute code again.\nThe code between the current location and the goto target is not executed but skipped.\nThe debug adapter first sends the response and then a `stopped` event with reason `goto`.\nClients should only call this request if the corresponding capability `supportsGotoTargetsRequest` is true (because only then goto targets exist that can be passed as arguments).", "properties": { "command": { "type": "string", @@ -1746,7 +1945,7 @@ }, "GotoArguments": { "type": "object", - "description": "Arguments for 'goto' request.", + "description": "Arguments for `goto` request.", "properties": { "threadId": { "type": "integer", @@ -1762,14 +1961,14 @@ "GotoResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'goto' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `goto` request. This is just an acknowledgement, so no body field is required." }] }, "PauseRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request suspends the debuggee.\nThe debug adapter first sends the response and then a 'stopped' event (with reason 'pause') after the thread has been paused successfully.", + "description": "The request suspends the debuggee.\nThe debug adapter first sends the response and then a `stopped` event (with reason `pause`) after the thread has been paused successfully.", "properties": { "command": { "type": "string", @@ -1784,7 +1983,7 @@ }, "PauseArguments": { "type": "object", - "description": "Arguments for 'pause' request.", + "description": "Arguments for `pause` request.", "properties": { "threadId": { "type": "integer", @@ -1796,14 +1995,14 @@ "PauseResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'pause' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `pause` request. This is just an acknowledgement, so no body field is required." }] }, "StackTraceRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request returns a stacktrace from the current execution state of a given thread.\nA client can request all stack frames by omitting the startFrame and levels arguments. For performance conscious clients and if the debug adapter's 'supportsDelayedStackTraceLoading' capability is true, stack frames can be retrieved in a piecemeal way with the startFrame and levels arguments. The response of the stackTrace request may contain a totalFrames property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of totalFrames decide how to proceed. In any case a client should be prepared to receive less frames than requested, which is an indication that the end of the stack has been reached.", + "description": "The request returns a stacktrace from the current execution state of a given thread.\nA client can request all stack frames by omitting the startFrame and levels arguments. For performance-conscious clients and if the corresponding capability `supportsDelayedStackTraceLoading` is true, stack frames can be retrieved in a piecemeal way with the `startFrame` and `levels` arguments. The response of the `stackTrace` request may contain a `totalFrames` property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of `totalFrames` decide how to proceed. In any case a client should be prepared to receive fewer frames than requested, which is an indication that the end of the stack has been reached.", "properties": { "command": { "type": "string", @@ -1818,7 +2017,7 @@ }, "StackTraceArguments": { "type": "object", - "description": "Arguments for 'stackTrace' request.", + "description": "Arguments for `stackTrace` request.", "properties": { "threadId": { "type": "integer", @@ -1834,7 +2033,7 @@ }, "format": { "$ref": "#/definitions/StackFrameFormat", - "description": "Specifies details on how to format the stack frames.\nThe attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true." + "description": "Specifies details on how to format the stack frames.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true." } }, "required": [ "threadId" ] @@ -1842,7 +2041,7 @@ "StackTraceResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'stackTrace' request.", + "description": "Response to `stackTrace` request.", "properties": { "body": { "type": "object", @@ -1852,11 +2051,11 @@ "items": { "$ref": "#/definitions/StackFrame" }, - "description": "The frames of the stackframe. If the array has length zero, there are no stackframes available.\nThis means that there is no location information available." + "description": "The frames of the stack frame. If the array has length zero, there are no stack frames available.\nThis means that there is no location information available." }, "totalFrames": { "type": "integer", - "description": "The total number of frames available in the stack. If omitted or if totalFrames is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). Returning monotonically increasing totalFrames values for subsequent requests can be used to enforce paging in the client." + "description": "The total number of frames available in the stack. If omitted or if `totalFrames` is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). Returning monotonically increasing `totalFrames` values for subsequent requests can be used to enforce paging in the client." } }, "required": [ "stackFrames" ] @@ -1869,7 +2068,7 @@ "ScopesRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request returns the variable scopes for a given stackframe ID.", + "description": "The request returns the variable scopes for a given stack frame ID.", "properties": { "command": { "type": "string", @@ -1884,11 +2083,11 @@ }, "ScopesArguments": { "type": "object", - "description": "Arguments for 'scopes' request.", + "description": "Arguments for `scopes` request.", "properties": { "frameId": { "type": "integer", - "description": "Retrieve the scopes for this stackframe." + "description": "Retrieve the scopes for the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details." } }, "required": [ "frameId" ] @@ -1896,7 +2095,7 @@ "ScopesResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'scopes' request.", + "description": "Response to `scopes` request.", "properties": { "body": { "type": "object", @@ -1906,7 +2105,7 @@ "items": { "$ref": "#/definitions/Scope" }, - "description": "The scopes of the stackframe. If the array has length zero, there are no scopes available." + "description": "The scopes of the stack frame. If the array has length zero, there are no scopes available." } }, "required": [ "scopes" ] @@ -1919,7 +2118,7 @@ "VariablesRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Retrieves all child variables for the given variable reference.\nAn optional filter can be used to limit the fetched children to either named or indexed children.", + "description": "Retrieves all child variables for the given variable reference.\nA filter can be used to limit the fetched children to either named or indexed children.", "properties": { "command": { "type": "string", @@ -1934,28 +2133,28 @@ }, "VariablesArguments": { "type": "object", - "description": "Arguments for 'variables' request.", + "description": "Arguments for `variables` request.", "properties": { "variablesReference": { "type": "integer", - "description": "The Variable reference." + "description": "The variable for which to retrieve its children. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details." }, "filter": { "type": "string", "enum": [ "indexed", "named" ], - "description": "Optional filter to limit the child variables to either named or indexed. If omitted, both types are fetched." + "description": "Filter to limit the child variables to either named or indexed. If omitted, both types are fetched." }, "start": { "type": "integer", - "description": "The index of the first variable to return; if omitted children start at 0." + "description": "The index of the first variable to return; if omitted children start at 0.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true." }, "count": { "type": "integer", - "description": "The number of variables to return. If count is missing or 0, all variables are returned." + "description": "The number of variables to return. If count is missing or 0, all variables are returned.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true." }, "format": { "$ref": "#/definitions/ValueFormat", - "description": "Specifies details on how to format the Variable values.\nThe attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true." + "description": "Specifies details on how to format the Variable values.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true." } }, "required": [ "variablesReference" ] @@ -1963,7 +2162,7 @@ "VariablesResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'variables' request.", + "description": "Response to `variables` request.", "properties": { "body": { "type": "object", @@ -1986,7 +2185,7 @@ "SetVariableRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Set the variable with the given name in the variable container to a new value. Clients should only call this request if the capability 'supportsSetVariable' is true.", + "description": "Set the variable with the given name in the variable container to a new value. Clients should only call this request if the corresponding capability `supportsSetVariable` is true.\nIf a debug adapter implements both `setVariable` and `setExpression`, a client will only use `setExpression` if the variable has an `evaluateName` property.", "properties": { "command": { "type": "string", @@ -2001,11 +2200,11 @@ }, "SetVariableArguments": { "type": "object", - "description": "Arguments for 'setVariable' request.", + "description": "Arguments for `setVariable` request.", "properties": { "variablesReference": { "type": "integer", - "description": "The reference of the variable container." + "description": "The reference of the variable container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details." }, "name": { "type": "string", @@ -2025,7 +2224,7 @@ "SetVariableResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'setVariable' request.", + "description": "Response to `setVariable` request.", "properties": { "body": { "type": "object", @@ -2040,15 +2239,23 @@ }, "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 `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details.\n\nIf this property is included in the response, any `variablesReference` previously associated with the updated variable, and those of its children, are no longer valid." }, "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 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 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", + "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true." + }, + "valueLocationReference": { + "type": "integer", + "description": "A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details." } }, "required": [ "value" ] @@ -2076,15 +2283,15 @@ }, "SourceArguments": { "type": "object", - "description": "Arguments for 'source' request.", + "description": "Arguments for `source` request.", "properties": { "source": { "$ref": "#/definitions/Source", - "description": "Specifies the source content to load. Either source.path or source.sourceReference must be specified." + "description": "Specifies the source content to load. Either `source.path` or `source.sourceReference` must be specified." }, "sourceReference": { "type": "integer", - "description": "The reference to the source. This is the same as source.sourceReference.\nThis is provided for backward compatibility since old backends do not understand the 'source' attribute." + "description": "The reference to the source. This is the same as `source.sourceReference`.\nThis is provided for backward compatibility since old clients do not understand the `source` attribute." } }, "required": [ "sourceReference" ] @@ -2092,7 +2299,7 @@ "SourceResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'source' request.", + "description": "Response to `source` request.", "properties": { "body": { "type": "object", @@ -2103,7 +2310,7 @@ }, "mimeType": { "type": "string", - "description": "Optional content type (mime type) of the source." + "description": "Content type (MIME type) of the source." } }, "required": [ "content" ] @@ -2129,7 +2336,7 @@ "ThreadsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'threads' request.", + "description": "Response to `threads` request.", "properties": { "body": { "type": "object", @@ -2152,7 +2359,7 @@ "TerminateThreadsRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "The request terminates the threads with the given ids.\nClients should only call this request if the capability 'supportsTerminateThreadsRequest' is true.", + "description": "The request terminates the threads with the given ids.\nClients should only call this request if the corresponding capability `supportsTerminateThreadsRequest` is true.", "properties": { "command": { "type": "string", @@ -2167,7 +2374,7 @@ }, "TerminateThreadsArguments": { "type": "object", - "description": "Arguments for 'terminateThreads' request.", + "description": "Arguments for `terminateThreads` request.", "properties": { "threadIds": { "type": "array", @@ -2181,14 +2388,14 @@ "TerminateThreadsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'terminateThreads' request. This is just an acknowledgement, so no body field is required." + "description": "Response to `terminateThreads` request. This is just an acknowledgement, no body field is required." }] }, "ModulesRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Modules can be retrieved from the debug adapter with this request which can either return all modules or a range of modules to support paging.\nClients should only call this request if the capability 'supportsModulesRequest' is true.", + "description": "Modules can be retrieved from the debug adapter with this request which can either return all modules or a range of modules to support paging.\nClients should only call this request if the corresponding capability `supportsModulesRequest` is true.", "properties": { "command": { "type": "string", @@ -2203,7 +2410,7 @@ }, "ModulesArguments": { "type": "object", - "description": "Arguments for 'modules' request.", + "description": "Arguments for `modules` request.", "properties": { "startModule": { "type": "integer", @@ -2211,14 +2418,14 @@ }, "moduleCount": { "type": "integer", - "description": "The number of modules to return. If moduleCount is not specified or 0, all modules are returned." + "description": "The number of modules to return. If `moduleCount` is not specified or 0, all modules are returned." } } }, "ModulesResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'modules' request.", + "description": "Response to `modules` request.", "properties": { "body": { "type": "object", @@ -2245,7 +2452,7 @@ "LoadedSourcesRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Retrieves the set of all sources currently loaded by the debugged process.\nClients should only call this request if the capability 'supportsLoadedSourcesRequest' is true.", + "description": "Retrieves the set of all sources currently loaded by the debugged process.\nClients should only call this request if the corresponding capability `supportsLoadedSourcesRequest` is true.", "properties": { "command": { "type": "string", @@ -2260,12 +2467,12 @@ }, "LoadedSourcesArguments": { "type": "object", - "description": "Arguments for 'loadedSources' request." + "description": "Arguments for `loadedSources` request." }, "LoadedSourcesResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'loadedSources' request.", + "description": "Response to `loadedSources` request.", "properties": { "body": { "type": "object", @@ -2288,7 +2495,7 @@ "EvaluateRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Evaluates the given expression in the context of the top most stack frame.\nThe expression has access to any variables and arguments that are in scope.", + "description": "Evaluates the given expression in the context of a stack frame.\nThe expression has access to any variables and arguments that are in scope.", "properties": { "command": { "type": "string", @@ -2303,7 +2510,7 @@ }, "EvaluateArguments": { "type": "object", - "description": "Arguments for 'evaluate' request.", + "description": "Arguments for `evaluate` request.", "properties": { "expression": { "type": "string", @@ -2313,20 +2520,33 @@ "type": "integer", "description": "Evaluate the expression in the scope of this stack frame. If not specified, the expression is evaluated in the global scope." }, + "line": { + "type": "integer", + "description": "The contextual line where the expression should be evaluated. In the 'hover' context, this should be set to the start of the expression being hovered." + }, + "column": { + "type": "integer", + "description": "The contextual column where the expression should be evaluated. This may be provided if `line` is also provided.\n\nIt is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." + }, + "source": { + "$ref": "#/definitions/Source", + "description": "The contextual source in which the `line` is found. This must be provided if `line` is provided." + }, "context": { "type": "string", - "_enum": [ "watch", "repl", "hover", "clipboard" ], + "_enum": [ "watch", "repl", "hover", "clipboard", "variables" ], "enumDescriptions": [ - "evaluate is run in a watch.", - "evaluate is run from REPL console.", - "evaluate is run from a data hover.", - "evaluate is run to generate the value that will be stored in the clipboard.\nThe attribute is only honored by a debug adapter if the capability 'supportsClipboardContext' is true." + "evaluate is called from a watch view context.", + "evaluate is called from a REPL context.", + "evaluate is called to generate the debug hover contents.\nThis value should only be used if the corresponding capability `supportsEvaluateForHovers` is true.", + "evaluate is called to generate clipboard contents.\nThis value should only be used if the corresponding capability `supportsClipboardContext` is true.", + "evaluate is called from a variables view context." ], - "description": "The context in which the evaluate request is run." + "description": "The context in which the evaluate request is used." }, "format": { "$ref": "#/definitions/ValueFormat", - "description": "Specifies details on how to format the Evaluate result.\nThe attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true." + "description": "Specifies details on how to format the result.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true." } }, "required": [ "expression" ] @@ -2334,7 +2554,7 @@ "EvaluateResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'evaluate' request.", + "description": "Response to `evaluate` request.", "properties": { "body": { "type": "object", @@ -2345,27 +2565,31 @@ }, "type": { "type": "string", - "description": "The optional type of the evaluate result.\nThis attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request." + "description": "The type of the evaluate result.\nThis attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true." }, "presentationHint": { "$ref": "#/definitions/VariablePresentationHint", - "description": "Properties of a evaluate result that can be used to determine how to render the result in the UI." + "description": "Properties of an evaluate result that can be used to determine how to render the result in the UI." }, "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 `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details." }, "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 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 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", - "description": "Optional memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute should be returned by a debug adapter if the client has passed the value true for the 'supportsMemoryReferences' capability of the 'initialize' request." + "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true." + }, + "valueLocationReference": { + "type": "integer", + "description": "A reference that allows the client to request the location where the returned value is declared. For example, if a function pointer is returned, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details." } }, "required": [ "result", "variablesReference" ] @@ -2378,7 +2602,7 @@ "SetExpressionRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Evaluates the given 'value' expression and assigns it to the 'expression' which must be a modifiable l-value.\nThe expressions have access to any variables and arguments that are in scope of the specified frame.\nClients should only call this request if the capability 'supportsSetExpression' is true.", + "description": "Evaluates the given `value` expression and assigns it to the `expression` which must be a modifiable l-value.\nThe expressions have access to any variables and arguments that are in scope of the specified frame.\nClients should only call this request if the corresponding capability `supportsSetExpression` is true.\nIf a debug adapter implements both `setExpression` and `setVariable`, a client uses `setExpression` if the variable has an `evaluateName` property.", "properties": { "command": { "type": "string", @@ -2393,7 +2617,7 @@ }, "SetExpressionArguments": { "type": "object", - "description": "Arguments for 'setExpression' request.", + "description": "Arguments for `setExpression` request.", "properties": { "expression": { "type": "string", @@ -2417,7 +2641,7 @@ "SetExpressionResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'setExpression' request.", + "description": "Response to `setExpression` request.", "properties": { "body": { "type": "object", @@ -2428,7 +2652,7 @@ }, "type": { "type": "string", - "description": "The optional type of the value.\nThis attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request." + "description": "The type of the value.\nThis attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true." }, "presentationHint": { "$ref": "#/definitions/VariablePresentationHint", @@ -2436,15 +2660,23 @@ }, "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 evaluate result is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details." }, "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 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 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", + "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true." + }, + "valueLocationReference": { + "type": "integer", + "description": "A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details." } }, "required": [ "value" ] @@ -2457,7 +2689,7 @@ "StepInTargetsRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "This request retrieves the possible stepIn targets for the specified stack frame.\nThese targets can be used in the 'stepIn' request.\nThe StepInTargets may only be called if the 'supportsStepInTargetsRequest' capability exists and is true.\nClients should only call this request if the capability 'supportsStepInTargetsRequest' is true.", + "description": "This request retrieves the possible step-in targets for the specified stack frame.\nThese targets can be used in the `stepIn` request.\nClients should only call this request if the corresponding capability `supportsStepInTargetsRequest` is true.", "properties": { "command": { "type": "string", @@ -2472,11 +2704,11 @@ }, "StepInTargetsArguments": { "type": "object", - "description": "Arguments for 'stepInTargets' request.", + "description": "Arguments for `stepInTargets` request.", "properties": { "frameId": { "type": "integer", - "description": "The stack frame for which to retrieve the possible stepIn targets." + "description": "The stack frame for which to retrieve the possible step-in targets." } }, "required": [ "frameId" ] @@ -2484,7 +2716,7 @@ "StepInTargetsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'stepInTargets' request.", + "description": "Response to `stepInTargets` request.", "properties": { "body": { "type": "object", @@ -2494,7 +2726,7 @@ "items": { "$ref": "#/definitions/StepInTarget" }, - "description": "The possible stepIn targets of the specified source location." + "description": "The possible step-in targets of the specified source location." } }, "required": [ "targets" ] @@ -2507,7 +2739,7 @@ "GotoTargetsRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "This request retrieves the possible goto targets for the specified source location.\nThese targets can be used in the 'goto' request.\nClients should only call this request if the capability 'supportsGotoTargetsRequest' is true.", + "description": "This request retrieves the possible goto targets for the specified source location.\nThese targets can be used in the `goto` request.\nClients should only call this request if the corresponding capability `supportsGotoTargetsRequest` is true.", "properties": { "command": { "type": "string", @@ -2522,7 +2754,7 @@ }, "GotoTargetsArguments": { "type": "object", - "description": "Arguments for 'gotoTargets' request.", + "description": "Arguments for `gotoTargets` request.", "properties": { "source": { "$ref": "#/definitions/Source", @@ -2534,7 +2766,7 @@ }, "column": { "type": "integer", - "description": "An optional column location for which the goto targets are determined." + "description": "The position within `line` for which the goto targets are determined. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." } }, "required": [ "source", "line" ] @@ -2542,7 +2774,7 @@ "GotoTargetsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'gotoTargets' request.", + "description": "Response to `gotoTargets` request.", "properties": { "body": { "type": "object", @@ -2565,7 +2797,7 @@ "CompletionsRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Returns a list of possible completions for a given caret position and text.\nClients should only call this request if the capability 'supportsCompletionsRequest' is true.", + "description": "Returns a list of possible completions for a given caret position and text.\nClients should only call this request if the corresponding capability `supportsCompletionsRequest` is true.", "properties": { "command": { "type": "string", @@ -2580,7 +2812,7 @@ }, "CompletionsArguments": { "type": "object", - "description": "Arguments for 'completions' request.", + "description": "Arguments for `completions` request.", "properties": { "frameId": { "type": "integer", @@ -2588,15 +2820,15 @@ }, "text": { "type": "string", - "description": "One or more source lines. Typically this is the text a user has typed into the debug console before he asked for completion." + "description": "One or more source lines. Typically this is the text users have typed into the debug console before they asked for completion." }, "column": { "type": "integer", - "description": "The character position for which to determine the completion proposals." + "description": "The position within `text` for which to determine the completion proposals. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." }, "line": { "type": "integer", - "description": "An optional line for which to determine the completion proposals. If missing the first line of the text is assumed." + "description": "A line for which to determine the completion proposals. If missing the first line of the text is assumed." } }, "required": [ "text", "column" ] @@ -2604,7 +2836,7 @@ "CompletionsResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'completions' request.", + "description": "Response to `completions` request.", "properties": { "body": { "type": "object", @@ -2627,7 +2859,7 @@ "ExceptionInfoRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Retrieves the details of the exception that caused this event to be raised.\nClients should only call this request if the capability 'supportsExceptionInfoRequest' is true.", + "description": "Retrieves the details of the exception that caused this event to be raised.\nClients should only call this request if the corresponding capability `supportsExceptionInfoRequest` is true.", "properties": { "command": { "type": "string", @@ -2642,7 +2874,7 @@ }, "ExceptionInfoArguments": { "type": "object", - "description": "Arguments for 'exceptionInfo' request.", + "description": "Arguments for `exceptionInfo` request.", "properties": { "threadId": { "type": "integer", @@ -2654,7 +2886,7 @@ "ExceptionInfoResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'exceptionInfo' request.", + "description": "Response to `exceptionInfo` request.", "properties": { "body": { "type": "object", @@ -2665,7 +2897,7 @@ }, "description": { "type": "string", - "description": "Descriptive text for the exception provided by the debug adapter." + "description": "Descriptive text for the exception." }, "breakMode": { "$ref": "#/definitions/ExceptionBreakMode", @@ -2686,7 +2918,7 @@ "ReadMemoryRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Reads bytes from memory at the provided location.\nClients should only call this request if the capability 'supportsReadMemoryRequest' is true.", + "description": "Reads bytes from memory at the provided location.\nClients should only call this request if the corresponding capability `supportsReadMemoryRequest` is true.", "properties": { "command": { "type": "string", @@ -2701,7 +2933,7 @@ }, "ReadMemoryArguments": { "type": "object", - "description": "Arguments for 'readMemory' request.", + "description": "Arguments for `readMemory` request.", "properties": { "memoryReference": { "type": "string", @@ -2709,7 +2941,7 @@ }, "offset": { "type": "integer", - "description": "Optional offset (in bytes) to be applied to the reference location before reading data. Can be negative." + "description": "Offset (in bytes) to be applied to the reference location before reading data. Can be negative." }, "count": { "type": "integer", @@ -2721,22 +2953,22 @@ "ReadMemoryResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'readMemory' request.", + "description": "Response to `readMemory` request.", "properties": { "body": { "type": "object", "properties": { "address": { "type": "string", - "description": "The address of the first byte of data returned.\nTreated as a hex value if prefixed with '0x', or as a decimal value otherwise." + "description": "The address of the first byte of data returned.\nTreated as a hex value if prefixed with `0x`, or as a decimal value otherwise." }, "unreadableBytes": { "type": "integer", - "description": "The number of unreadable bytes encountered after the last successfully read byte.\nThis can be used to determine the number of bytes that must be skipped before a subsequent 'readMemory' request will succeed." + "description": "The number of unreadable bytes encountered after the last successfully read byte.\nThis can be used to determine the number of bytes that should be skipped before a subsequent `readMemory` request succeeds." }, "data": { "type": "string", - "description": "The bytes read from memory, encoded using base64." + "description": "The bytes read from memory, encoded using base64. If the decoded length of `data` is less than the requested `count` in the original `readMemory` request, and `unreadableBytes` is zero or omitted, then the client should assume it's reached the end of readable memory." } }, "required": [ "address" ] @@ -2745,10 +2977,71 @@ }] }, + "WriteMemoryRequest": { + "allOf": [ { "$ref": "#/definitions/Request" }, { + "type": "object", + "description": "Writes bytes to memory at the provided location.\nClients should only call this request if the corresponding capability `supportsWriteMemoryRequest` is true.", + "properties": { + "command": { + "type": "string", + "enum": [ "writeMemory" ] + }, + "arguments": { + "$ref": "#/definitions/WriteMemoryArguments" + } + }, + "required": [ "command", "arguments" ] + }] + }, + "WriteMemoryArguments": { + "type": "object", + "description": "Arguments for `writeMemory` request.", + "properties": { + "memoryReference": { + "type": "string", + "description": "Memory reference to the base location to which data should be written." + }, + "offset": { + "type": "integer", + "description": "Offset (in bytes) to be applied to the reference location before writing data. Can be negative." + }, + "allowPartial": { + "type": "boolean", + "description": "Property to control partial writes. If true, the debug adapter should attempt to write memory even if the entire memory region is not writable. In such a case the debug adapter should stop after hitting the first byte of memory that cannot be written and return the number of bytes written in the response via the `offset` and `bytesWritten` properties.\nIf false or missing, a debug adapter should attempt to verify the region is writable before writing, and fail the response if it is not." + }, + "data": { + "type": "string", + "description": "Bytes to write, encoded using base64." + } + }, + "required": [ "memoryReference", "data" ] + }, + "WriteMemoryResponse": { + "allOf": [ { "$ref": "#/definitions/Response" }, { + "type": "object", + "description": "Response to `writeMemory` request.", + "properties": { + "body": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "description": "Property that should be returned when `allowPartial` is true to indicate the offset of the first byte of data successfully written. Can be negative." + }, + "bytesWritten": { + "type": "integer", + "description": "Property that should be returned when `allowPartial` is true to indicate the number of bytes starting from address that were successfully written." + } + } + } + } + }] + }, + "DisassembleRequest": { "allOf": [ { "$ref": "#/definitions/Request" }, { "type": "object", - "description": "Disassembles code stored at the provided location.\nClients should only call this request if the capability 'supportsDisassembleRequest' is true.", + "description": "Disassembles code stored at the provided location.\nClients should only call this request if the corresponding capability `supportsDisassembleRequest` is true.", "properties": { "command": { "type": "string", @@ -2763,7 +3056,7 @@ }, "DisassembleArguments": { "type": "object", - "description": "Arguments for 'disassemble' request.", + "description": "Arguments for `disassemble` request.", "properties": { "memoryReference": { "type": "string", @@ -2771,11 +3064,11 @@ }, "offset": { "type": "integer", - "description": "Optional offset (in bytes) to be applied to the reference location before disassembling. Can be negative." + "description": "Offset (in bytes) to be applied to the reference location before disassembling. Can be negative." }, "instructionOffset": { "type": "integer", - "description": "Optional offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative." + "description": "Offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative." }, "instructionCount": { "type": "integer", @@ -2791,7 +3084,7 @@ "DisassembleResponse": { "allOf": [ { "$ref": "#/definitions/Response" }, { "type": "object", - "description": "Response to 'disassemble' request.", + "description": "Response to `disassemble` request.", "properties": { "body": { "type": "object", @@ -2810,6 +3103,68 @@ }] }, + "LocationsRequest": { + "allOf": [ { "$ref": "#/definitions/Request" }, { + "type": "object", + "description": "Looks up information about a location reference previously returned by the debug adapter.", + "properties": { + "command": { + "type": "string", + "enum": [ "locations" ] + }, + "arguments": { + "$ref": "#/definitions/LocationsArguments" + } + }, + "required": [ "command", "arguments" ] + }] + }, + "LocationsArguments": { + "type": "object", + "description": "Arguments for `locations` request.", + "properties": { + "locationReference": { + "type": "integer", + "description": "Location reference to resolve." + } + }, + "required": [ "locationReference" ] + }, + "LocationsResponse": { + "allOf": [ { "$ref": "#/definitions/Response" }, { + "type": "object", + "description": "Response to `locations` request.", + "properties": { + "body": { + "type": "object", + "properties": { + "source": { + "$ref": "#/definitions/Source", + "description": "The source containing the location; either `source.path` or `source.sourceReference` must be specified." + }, + "line": { + "type": "integer", + "description": "The line number of the location. The client capability `linesStartAt1` determines whether it is 0- or 1-based." + }, + "column": { + "type": "integer", + "description": "Position of the location within the `line`. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed." + }, + "endLine": { + "type": "integer", + "description": "End line of the location, present if the location refers to a range. The client capability `linesStartAt1` determines whether it is 0- or 1-based." + }, + "endColumn": { + "type": "integer", + "description": "End position of the location within `endLine`, present if the location refers to a range. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." + } + }, + "required": [ "source", "line" ] + } + } + }] + }, + "Capabilities": { "type": "object", "title": "Types", @@ -2817,7 +3172,7 @@ "properties": { "supportsConfigurationDoneRequest": { "type": "boolean", - "description": "The debug adapter supports the 'configurationDone' request." + "description": "The debug adapter supports the `configurationDone` request." }, "supportsFunctionBreakpoints": { "type": "boolean", @@ -2833,18 +3188,18 @@ }, "supportsEvaluateForHovers": { "type": "boolean", - "description": "The debug adapter supports a (side effect free) evaluate request for data hovers." + "description": "The debug adapter supports a (side effect free) `evaluate` request for data hovers." }, "exceptionBreakpointFilters": { "type": "array", "items": { "$ref": "#/definitions/ExceptionBreakpointsFilter" }, - "description": "Available exception filter options for the 'setExceptionBreakpoints' request." + "description": "Available exception filter options for the `setExceptionBreakpoints` request." }, "supportsStepBack": { "type": "boolean", - "description": "The debug adapter supports stepping back via the 'stepBack' and 'reverseContinue' requests." + "description": "The debug adapter supports stepping back via the `stepBack` and `reverseContinue` requests." }, "supportsSetVariable": { "type": "boolean", @@ -2856,26 +3211,26 @@ }, "supportsGotoTargetsRequest": { "type": "boolean", - "description": "The debug adapter supports the 'gotoTargets' request." + "description": "The debug adapter supports the `gotoTargets` request." }, "supportsStepInTargetsRequest": { "type": "boolean", - "description": "The debug adapter supports the 'stepInTargets' request." + "description": "The debug adapter supports the `stepInTargets` request." }, "supportsCompletionsRequest": { "type": "boolean", - "description": "The debug adapter supports the 'completions' request." + "description": "The debug adapter supports the `completions` request." }, "completionTriggerCharacters": { "type": "array", "items": { "type": "string" }, - "description": "The set of characters that should trigger completion in a REPL. If not specified, the UI should assume the '.' character." + "description": "The set of characters that should trigger completion in a REPL. If not specified, the UI should assume the `.` character." }, "supportsModulesRequest": { "type": "boolean", - "description": "The debug adapter supports the 'modules' request." + "description": "The debug adapter supports the `modules` request." }, "additionalModuleColumns": { "type": "array", @@ -2893,47 +3248,51 @@ }, "supportsRestartRequest": { "type": "boolean", - "description": "The debug adapter supports the 'restart' request. In this case a client should not implement 'restart' by terminating and relaunching the adapter but by calling the RestartRequest." + "description": "The debug adapter supports the `restart` request. In this case a client should not implement `restart` by terminating and relaunching the adapter but by calling the `restart` request." }, "supportsExceptionOptions": { "type": "boolean", - "description": "The debug adapter supports 'exceptionOptions' on the setExceptionBreakpoints request." + "description": "The debug adapter supports `exceptionOptions` on the `setExceptionBreakpoints` request." }, "supportsValueFormattingOptions": { "type": "boolean", - "description": "The debug adapter supports a 'format' attribute on the stackTraceRequest, variablesRequest, and evaluateRequest." + "description": "The debug adapter supports a `format` attribute on the `stackTrace`, `variables`, and `evaluate` requests." }, "supportsExceptionInfoRequest": { "type": "boolean", - "description": "The debug adapter supports the 'exceptionInfo' request." + "description": "The debug adapter supports the `exceptionInfo` request." }, "supportTerminateDebuggee": { "type": "boolean", - "description": "The debug adapter supports the 'terminateDebuggee' attribute on the 'disconnect' request." + "description": "The debug adapter supports the `terminateDebuggee` attribute on the `disconnect` request." + }, + "supportSuspendDebuggee": { + "type": "boolean", + "description": "The debug adapter supports the `suspendDebuggee` attribute on the `disconnect` request." }, "supportsDelayedStackTraceLoading": { "type": "boolean", - "description": "The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and an optional 'totalFrames' result of the 'StackTrace' request are supported." + "description": "The debug adapter supports the delayed loading of parts of the stack, which requires that both the `startFrame` and `levels` arguments and the `totalFrames` result of the `stackTrace` request are supported." }, "supportsLoadedSourcesRequest": { "type": "boolean", - "description": "The debug adapter supports the 'loadedSources' request." + "description": "The debug adapter supports the `loadedSources` request." }, "supportsLogPoints": { "type": "boolean", - "description": "The debug adapter supports logpoints by interpreting the 'logMessage' attribute of the SourceBreakpoint." + "description": "The debug adapter supports log points by interpreting the `logMessage` attribute of the `SourceBreakpoint`." }, "supportsTerminateThreadsRequest": { "type": "boolean", - "description": "The debug adapter supports the 'terminateThreads' request." + "description": "The debug adapter supports the `terminateThreads` request." }, "supportsSetExpression": { "type": "boolean", - "description": "The debug adapter supports the 'setExpression' request." + "description": "The debug adapter supports the `setExpression` request." }, "supportsTerminateRequest": { "type": "boolean", - "description": "The debug adapter supports the 'terminate' request." + "description": "The debug adapter supports the `terminate` request." }, "supportsDataBreakpoints": { "type": "boolean", @@ -2941,27 +3300,31 @@ }, "supportsReadMemoryRequest": { "type": "boolean", - "description": "The debug adapter supports the 'readMemory' request." + "description": "The debug adapter supports the `readMemory` request." + }, + "supportsWriteMemoryRequest": { + "type": "boolean", + "description": "The debug adapter supports the `writeMemory` request." }, "supportsDisassembleRequest": { "type": "boolean", - "description": "The debug adapter supports the 'disassemble' request." + "description": "The debug adapter supports the `disassemble` request." }, "supportsCancelRequest": { "type": "boolean", - "description": "The debug adapter supports the 'cancel' request." + "description": "The debug adapter supports the `cancel` request." }, "supportsBreakpointLocationsRequest": { "type": "boolean", - "description": "The debug adapter supports the 'breakpointLocations' request." + "description": "The debug adapter supports the `breakpointLocations` request." }, "supportsClipboardContext": { "type": "boolean", - "description": "The debug adapter supports the 'clipboard' context value in the 'evaluate' request." + "description": "The debug adapter supports the `clipboard` context value in the `evaluate` request." }, "supportsSteppingGranularity": { "type": "boolean", - "description": "The debug adapter supports stepping granularities (argument 'granularity') for the stepping requests." + "description": "The debug adapter supports stepping granularities (argument `granularity`) for the stepping requests." }, "supportsInstructionBreakpoints": { "type": "boolean", @@ -2969,30 +3332,57 @@ }, "supportsExceptionFilterOptions": { "type": "boolean", - "description": "The debug adapter supports 'filterOptions' as an argument on the 'setExceptionBreakpoints' request." + "description": "The debug adapter supports `filterOptions` as an argument on the `setExceptionBreakpoints` request." + }, + "supportsSingleThreadExecutionRequests": { + "type": "boolean", + "description": "The debug adapter supports the `singleThread` property on the execution requests (`continue`, `next`, `stepIn`, `stepOut`, `reverseContinue`, `stepBack`)." + }, + "supportsDataBreakpointBytes": { + "type": "boolean", + "description": "The debug adapter supports the `asAddress` and `bytes` fields in the `dataBreakpointInfo` request." + }, + "breakpointModes": { + "type": "array", + "items": { + "$ref": "#/definitions/BreakpointMode" + }, + "description": "Modes of breakpoints supported by the debug adapter, such as 'hardware' or 'software'. If present, the client may allow the user to select a mode and include it in its `setBreakpoints` request.\n\nClients may present the first applicable mode in this array as the 'default' mode in gestures that set breakpoints." + }, + "supportsANSIStyling": { + "type": "boolean", + "description": "The debug adapter supports ANSI escape sequences in styling of `OutputEvent.output` and `Variable.value` fields." } } }, "ExceptionBreakpointsFilter": { "type": "object", - "description": "An ExceptionBreakpointsFilter is shown in the UI as an filter 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 option. 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 option. This will be shown in the UI." + "description": "The name of the filter option. This is shown in the UI." + }, + "description": { + "type": "string", + "description": "A help text providing additional information about the exception filter. This string is typically shown as a hover and can be translated." }, "default": { "type": "boolean", - "description": "Initial value of the filter option. 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." + }, + "conditionDescription": { + "type": "string", + "description": "A help text providing information about the condition. This string is shown as the placeholder text for a text box and can be translated." } }, "required": [ "filter", "label" ] @@ -3004,18 +3394,18 @@ "properties": { "id": { "type": "integer", - "description": "Unique identifier for the message." + "description": "Unique (within a debug adapter implementation) identifier for the message. The purpose of these error IDs is to help extension authors that have the requirement that every user visible error message needs a corresponding error number, so that users or customer support can find information about the specific error more easily." }, "format": { "type": "string", - "description": "A format string for the message. Embedded variables have the form '{name}'.\nIf variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes." + "description": "A format string for the message. Embedded variables have the form `{name}`.\nIf variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes." }, "variables": { "type": "object", "description": "An object used as a dictionary for looking up the variables in the format string.", "additionalProperties": { "type": "string", - "description": "Values must be strings." + "description": "All dictionary values must be strings." } }, "sendTelemetry": { @@ -3028,11 +3418,11 @@ }, "url": { "type": "string", - "description": "An optional url where additional information about this message can be found." + "description": "A url where additional information about this message can be found." }, "urlLabel": { "type": "string", - "description": "An optional label that is presented to the user as the UI for opening the url." + "description": "A label that is presented to the user as the UI for opening the url." } }, "required": [ "id", "format" ] @@ -3040,7 +3430,7 @@ "Module": { "type": "object", - "description": "A Module object represents a row in the modules view.\nTwo attributes are mandatory: an id identifies a module in the modules view and is used in a ModuleEvent for identifying a module for adding, updating or deleting.\nThe name is used to minimally render the module in the UI.\n\nAdditional attributes can be added to the module. They will show up in the module View if they have a corresponding ColumnDescriptor.\n\nTo avoid an unnecessary proliferation of additional attributes with similar semantics but different names\nwe recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found.", + "description": "A Module object represents a row in the modules view.\nThe `id` attribute identifies a module in the modules view and is used in a `module` event for identifying a module for adding, updating or deleting.\nThe `name` attribute is used to minimally render the module in the UI.\n\nAdditional attributes can be added to the module. They show up in the module view if they have a corresponding `ColumnDescriptor`.\n\nTo avoid an unnecessary proliferation of additional attributes with similar semantics but different names, we recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found.", "properties": { "id": { "type": ["integer", "string"], @@ -3052,7 +3442,7 @@ }, "path": { "type": "string", - "description": "optional but recommended attributes.\nalways try to use these first before introducing additional attributes.\n\nLogical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module." + "description": "Logical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module." }, "isOptimized": { "type": "boolean", @@ -3068,7 +3458,7 @@ }, "symbolStatus": { "type": "string", - "description": "User understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc." + "description": "User-understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc.)" }, "symbolFilePath": { "type": "string", @@ -3076,7 +3466,7 @@ }, "dateTimeStamp": { "type": "string", - "description": "Module created or modified." + "description": "Module created or modified, encoded as a RFC 3339 timestamp." }, "addressRange": { "type": "string", @@ -3088,7 +3478,7 @@ "ColumnDescriptor": { "type": "object", - "description": "A ColumnDescriptor specifies what module attribute to show in a column of the ModulesView, how to format it,\nand what the column's label should be.\nIt is only used if the underlying UI actually supports this level of customization.", + "description": "A `ColumnDescriptor` specifies what module attribute to show in a column of the modules view, how to format it,\nand what the column's label should be.\nIt is only used if the underlying UI actually supports this level of customization.", "properties": { "attributeName": { "type": "string", @@ -3105,7 +3495,7 @@ "type": { "type": "string", "enum": [ "string", "number", "boolean", "unixTimestampUTC" ], - "description": "Datatype of values in this column. Defaults to 'string' if not specified." + "description": "Datatype of values in this column. Defaults to `string` if not specified." }, "width": { "type": "integer", @@ -3115,20 +3505,6 @@ "required": [ "attributeName", "label"] }, - "ModulesViewDescriptor": { - "type": "object", - "description": "The ModulesViewDescriptor is the container for all declarative configuration options of a ModuleView.\nFor now it only specifies the columns to be shown in the modules view.", - "properties": { - "columns": { - "type": "array", - "items": { - "$ref": "#/definitions/ColumnDescriptor" - } - } - }, - "required": [ "columns" ] - }, - "Thread": { "type": "object", "description": "A Thread", @@ -3139,7 +3515,7 @@ }, "name": { "type": "string", - "description": "A name of the thread." + "description": "The name of the thread." } }, "required": [ "id", "name" ] @@ -3147,7 +3523,7 @@ "Source": { "type": "object", - "description": "A Source is a descriptor for source code.\nIt is returned from the debug adapter as part of a StackFrame and it is used by clients when specifying breakpoints.", + "description": "A `Source` is a descriptor for source code.\nIt is returned from the debug adapter as part of a `StackFrame` and it is used by clients when specifying breakpoints.", "properties": { "name": { "type": "string", @@ -3155,31 +3531,31 @@ }, "path": { "type": "string", - "description": "The path of the source to be shown in the UI.\nIt is only used to locate and load the content of the source if no sourceReference is specified (or its value is 0)." + "description": "The path of the source to be shown in the UI.\nIt is only used to locate and load the content of the source if no `sourceReference` is specified (or its value is 0)." }, "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 the value > 0 the contents of the source must be retrieved through the `source` request (even if a path is specified).\nSince a `sourceReference` is only valid for a session, it can not be used to persist a source.\nThe value should be less than or equal to 2147483647 (2^31-1)." }, "presentationHint": { "type": "string", - "description": "An optional hint for how to present the source in the UI.\nA value of 'deemphasize' can be used to indicate that the source is not available or that it is skipped on stepping.", + "description": "A hint for how to present the source in the UI.\nA value of `deemphasize` can be used to indicate that the source is not available or that it is skipped on stepping.", "enum": [ "normal", "emphasize", "deemphasize" ] }, "origin": { "type": "string", - "description": "The (optional) origin of this source: possible values 'internal module', 'inlined content from source map', etc." + "description": "The origin of this source. For example, 'internal module', 'inlined content from source map', etc." }, "sources": { "type": "array", "items": { "$ref": "#/definitions/Source" }, - "description": "An optional list of sources that are related to this source. These may be the source that generated this source." + "description": "A list of sources that are related to this source. These may be the source that generated this source." }, "adapterData": { "type": [ "array", "boolean", "integer", "null", "number", "object", "string" ], - "description": "Optional data that a debug adapter might want to loop through the client.\nThe client should leave the data intact and persist it across sessions. The client should not interpret the data." + "description": "Additional data that a debug adapter might want to loop through the client.\nThe client should leave the data intact and persist it across sessions. The client should not interpret the data." }, "checksums": { "type": "array", @@ -3197,7 +3573,7 @@ "properties": { "id": { "type": "integer", - "description": "An identifier for the stack frame. It must be unique across all threads.\nThis id can be used to retrieve the scopes of the frame with the 'scopesRequest' or to restart the execution of a stackframe." + "description": "An identifier for the stack frame. It must be unique across all threads.\nThis id can be used to retrieve the scopes of the frame with the `scopes` request or to restart the execution of a stack frame." }, "name": { "type": "string", @@ -3205,27 +3581,31 @@ }, "source": { "$ref": "#/definitions/Source", - "description": "The optional source of the frame." + "description": "The source of the frame." }, "line": { "type": "integer", - "description": "The line within the file of the frame. If source is null or doesn't exist, line is 0 and must be ignored." + "description": "The line within the source of the frame. If the source attribute is missing or doesn't exist, `line` is 0 and should be ignored by the client." }, "column": { "type": "integer", - "description": "The column within the line. If source is null or doesn't exist, column is 0 and must be ignored." + "description": "Start position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If attribute `source` is missing or doesn't exist, `column` is 0 and should be ignored by the client." }, "endLine": { "type": "integer", - "description": "An optional end line of the range covered by the stack frame." + "description": "The end line of the range covered by the stack frame." }, "endColumn": { "type": "integer", - "description": "An optional end column of the range covered by the stack frame." + "description": "End position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." + }, + "canRestart": { + "type": "boolean", + "description": "Indicates whether this frame can be restarted with the `restartFrame` request. Clients should only use this if the debug adapter supports the `restart` request and the corresponding capability `supportsRestartFrame` is true. If a debug adapter has this capability, then `canRestart` defaults to `true` if the property is absent." }, "instructionPointerReference": { "type": "string", - "description": "Optional memory reference for the current instruction pointer in this frame." + "description": "A memory reference for the current instruction pointer in this frame." }, "moduleId": { "type": ["integer", "string"], @@ -3234,7 +3614,7 @@ "presentationHint": { "type": "string", "enum": [ "normal", "label", "subtle" ], - "description": "An optional hint for how to present this frame in the UI.\nA value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way." + "description": "A hint for how to present this frame in the UI.\nA value of `label` can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of `subtle` can be used to change the appearance of a frame in a 'subtle' way." } }, "required": [ "id", "name", "line", "column" ] @@ -3242,7 +3622,7 @@ "Scope": { "type": "object", - "description": "A Scope is a named container for variables. Optionally a scope can map to a source or a range within a source.", + "description": "A `Scope` is a named container for variables. Optionally a scope can map to a source or a range within a source.", "properties": { "name": { "type": "string", @@ -3250,25 +3630,26 @@ }, "presentationHint": { "type": "string", - "description": "An optional hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI.", - "_enum": [ "arguments", "locals", "registers" ], + "description": "A hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI.", + "_enum": [ "arguments", "locals", "registers", "returnValue" ], "enumDescriptions": [ "Scope contains method arguments.", "Scope contains local variables.", - "Scope contains registers. Only a single 'registers' scope should be returned from a 'scopes' request." + "Scope contains registers. Only a single `registers` scope should be returned from a `scopes` request.", + "Scope contains one or more return values." ] }, "variablesReference": { "type": "integer", - "description": "The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest." + "description": "The variables of this scope can be retrieved by passing the value of `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details." }, "namedVariables": { "type": "integer", - "description": "The number of named variables in this scope.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks." + "description": "The number of named variables in this scope.\nThe client can use this information to present the variables in a paged UI and fetch them in chunks." }, "indexedVariables": { "type": "integer", - "description": "The number of indexed variables in this scope.\nThe client can use this optional information to present the variables in a paged UI and fetch them in chunks." + "description": "The number of indexed variables in this scope.\nThe client can use this information to present the variables in a paged UI and fetch them in chunks." }, "expensive": { "type": "boolean", @@ -3276,23 +3657,23 @@ }, "source": { "$ref": "#/definitions/Source", - "description": "Optional source for this scope." + "description": "The source for this scope." }, "line": { "type": "integer", - "description": "Optional start line of the range covered by this scope." + "description": "The start line of the range covered by this scope." }, "column": { "type": "integer", - "description": "Optional start column of the range covered by this scope." + "description": "Start position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." }, "endLine": { "type": "integer", - "description": "Optional end line of the range covered by this scope." + "description": "The end line of the range covered by this scope." }, "endColumn": { "type": "integer", - "description": "Optional end column of the range covered by this scope." + "description": "End position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." } }, "required": [ "name", "variablesReference", "expensive" ] @@ -3300,7 +3681,7 @@ "Variable": { "type": "object", - "description": "A Variable is a name/value pair.\nOptionally a variable can have a 'type' that is shown if space permits or when hovering over the variable's name.\nAn optional 'kind' is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private.\nIf the value is structured (has children), a handle is provided to retrieve the children with the VariablesRequest.\nIf the number of named or indexed children is large, the numbers should be returned via the optional 'namedVariables' and 'indexedVariables' attributes.\nThe client can use this optional information to present the children in a paged UI and fetch them in chunks.", + "description": "A Variable is a name/value pair.\nThe `type` attribute is shown if space permits or when hovering over the variable's name.\nThe `kind` attribute is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private.\nIf the value is structured (has children), a handle is provided to retrieve the children with the `variables` request.\nIf the number of named or indexed children is large, the numbers should be returned via the `namedVariables` and `indexedVariables` attributes.\nThe client can use this information to present the children in a paged UI and fetch them in chunks.", "properties": { "name": { "type": "string", @@ -3308,11 +3689,11 @@ }, "value": { "type": "string", - "description": "The variable's value. This can be a multi-line text, e.g. for a function the body of a function." + "description": "The variable's value.\nThis can be a multi-line text, e.g. for a function the body of a function.\nFor structured variables (which do not have a simple value), it is recommended to provide a one-line representation of the structured object. This helps to identify the structured object in the collapsed state when its children are not yet visible.\nAn empty string can be used if no value should be shown in the UI." }, "type": { "type": "string", - "description": "The type of the variable's value. Typically shown in the UI when hovering over the value.\nThis attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request." + "description": "The type of the variable's value. Typically shown in the UI when hovering over the value.\nThis attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true." }, "presentationHint": { "$ref": "#/definitions/VariablePresentationHint", @@ -3320,23 +3701,31 @@ }, "evaluateName": { "type": "string", - "description": "Optional evaluatable name of this variable which can be passed to the 'EvaluateRequest' to fetch the variable's value." + "description": "The evaluatable name of this variable which can be passed to the `evaluate` request to fetch the variable's value." }, "variablesReference": { "type": "integer", - "description": "If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest." + "description": "If `variablesReference` is > 0, the variable is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details." }, "namedVariables": { "type": "integer", - "description": "The number of named child variables.\nThe client can use this optional information to present the children in a paged UI and fetch them in chunks." + "description": "The number of named child variables.\nThe client can use this information to present the children in a paged UI and fetch them in chunks." }, "indexedVariables": { "type": "integer", - "description": "The number of indexed child variables.\nThe client can use this optional information to present the children in a paged UI and fetch them in chunks." + "description": "The number of indexed child variables.\nThe client can use this information to present the children in a paged UI and fetch them in chunks." }, "memoryReference": { "type": "string", - "description": "Optional memory reference for the variable if the variable represents executable code, such as a function pointer.\nThis attribute is only required if the client has passed the value true for the 'supportsMemoryReferences' capability of the 'initialize' request." + "description": "A memory reference associated with this variable.\nFor pointer type variables, this is generally a reference to the memory address contained in the pointer.\nFor executable data, this reference may later be used in a `disassemble` request.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true." + }, + "declarationLocationReference": { + "type": "integer", + "description": "A reference that allows the client to request the location where the variable is declared. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details." + }, + "valueLocationReference": { + "type": "integer", + "description": "A reference that allows the client to request the location where the variable's value is declared. For example, if the variable contains a function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details." } }, "required": [ "name", "value", "variablesReference" ] @@ -3344,7 +3733,7 @@ "VariablePresentationHint": { "type": "object", - "description": "Optional properties of a variable that can be used to determine how to render the variable in the UI.", + "description": "Properties of a variable that can be used to determine how to render the variable in the UI.", "properties": { "kind": { "description": "The kind of variable. Before introducing additional values, try to use the listed values.", @@ -3360,8 +3749,8 @@ "Indicates that the object is an inner class.", "Indicates that the object is an interface.", "Indicates that the object is the most derived class.", - "Indicates that the object is virtual, that means it is a synthetic object introducedby the\nadapter for rendering purposes, e.g. an index range for large arrays.", - "Indicates that a data breakpoint is registered for the object." + "Indicates that the object is virtual, that means it is a synthetic object introduced by the adapter for rendering purposes, e.g. an index range for large arrays.", + "Deprecated: Indicates that a data breakpoint is registered for the object. The `hasDataBreakpoint` attribute should generally be used instead." ] }, "attributes": { @@ -3369,15 +3758,16 @@ "type": "array", "items": { "type": "string", - "_enum": [ "static", "constant", "readOnly", "rawString", "hasObjectId", "canHaveObjectId", "hasSideEffects" ], + "_enum": [ "static", "constant", "readOnly", "rawString", "hasObjectId", "canHaveObjectId", "hasSideEffects", "hasDataBreakpoint" ], "enumDescriptions": [ "Indicates that the object is static.", "Indicates that the object is a constant.", "Indicates that the object is read only.", "Indicates that the object is a raw string.", - "Indicates that the object can have an Object ID created for it.", - "Indicates that the object has an Object ID associated with it.", - "Indicates that the evaluation had side effects." + "Indicates that the object can have an Object ID created for it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.", + "Indicates that the object has an Object ID associated with it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.", + "Indicates that the evaluation had side effects.", + "Indicates that the object has its value tracked by a data breakpoint." ] } }, @@ -3385,13 +3775,17 @@ "description": "Visibility of variable. Before introducing additional values, try to use the listed values.", "type": "string", "_enum": [ "public", "private", "protected", "internal", "final" ] + }, + "lazy": { + "description": "If true, clients can present the variable with a UI that supports a specific gesture to trigger its evaluation.\nThis mechanism can be used for properties that require executing code when retrieving their value and where the code execution can be expensive and/or produce side-effects. A typical example are properties based on a getter function.\nPlease note that in addition to the `lazy` flag, the variable's `variablesReference` is expected to refer to a variable that will provide the value through another `variable` request.", + "type": "boolean" } } }, "BreakpointLocation": { "type": "object", - "description": "Properties of a breakpoint location returned from the 'breakpointLocations' request.", + "description": "Properties of a breakpoint location returned from the `breakpointLocations` request.", "properties": { "line": { "type": "integer", @@ -3399,15 +3793,15 @@ }, "column": { "type": "integer", - "description": "Optional start column of breakpoint location." + "description": "The start position of a breakpoint location. Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." }, "endLine": { "type": "integer", - "description": "Optional end line of breakpoint location if the location covers a range." + "description": "The end line of breakpoint location if the location covers a range." }, "endColumn": { "type": "integer", - "description": "Optional end column of breakpoint location if the location covers a range." + "description": "The end position of a breakpoint location (if the location covers a range). Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." } }, "required": [ "line" ] @@ -3415,7 +3809,7 @@ "SourceBreakpoint": { "type": "object", - "description": "Properties of a breakpoint or logpoint passed to the setBreakpoints request.", + "description": "Properties of a breakpoint or logpoint passed to the `setBreakpoints` request.", "properties": { "line": { "type": "integer", @@ -3423,19 +3817,23 @@ }, "column": { "type": "integer", - "description": "An optional source column of the breakpoint." + "description": "Start position within source line of the breakpoint or logpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." }, "condition": { "type": "string", - "description": "An optional expression for conditional breakpoints.\nIt is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true." + "description": "The expression for conditional breakpoints.\nIt is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true." }, "hitCondition": { "type": "string", - "description": "An optional expression that controls how many hits of the breakpoint are ignored.\nThe backend is expected to interpret the expression as needed.\nThe attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true." + "description": "The expression that controls how many hits of the breakpoint are ignored.\nThe debug adapter is expected to interpret the expression as needed.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true.\nIf both this property and `condition` are specified, `hitCondition` should be evaluated only if the `condition` is met, and the debug adapter should stop only if both conditions are met." }, "logMessage": { "type": "string", - "description": "If this attribute exists and is non-empty, the backend must not 'break' (stop)\nbut log the message instead. Expressions within {} are interpolated.\nThe attribute is only honored by a debug adapter if the capability 'supportsLogPoints' is true." + "description": "If this attribute exists and is non-empty, the debug adapter must not 'break' (stop)\nbut log the message instead. Expressions within `{}` are interpolated.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsLogPoints` is true.\nIf either `hitCondition` or `condition` is specified, then the message should only be logged if those conditions are met." + }, + "mode": { + "type": "string", + "description": "The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`." } }, "required": [ "line" ] @@ -3443,7 +3841,7 @@ "FunctionBreakpoint": { "type": "object", - "description": "Properties of a breakpoint passed to the setFunctionBreakpoints request.", + "description": "Properties of a breakpoint passed to the `setFunctionBreakpoints` request.", "properties": { "name": { "type": "string", @@ -3451,11 +3849,11 @@ }, "condition": { "type": "string", - "description": "An optional expression for conditional breakpoints.\nIt is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true." + "description": "An expression for conditional breakpoints.\nIt is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true." }, "hitCondition": { "type": "string", - "description": "An optional expression that controls how many hits of the breakpoint are ignored.\nThe backend is expected to interpret the expression as needed.\nThe attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true." + "description": "An expression that controls how many hits of the breakpoint are ignored.\nThe debug adapter is expected to interpret the expression as needed.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true." } }, "required": [ "name" ] @@ -3469,11 +3867,11 @@ "DataBreakpoint": { "type": "object", - "description": "Properties of a data breakpoint passed to the setDataBreakpoints request.", + "description": "Properties of a data breakpoint passed to the `setDataBreakpoints` request.", "properties": { "dataId": { "type": "string", - "description": "An id representing the data. This id is returned from the dataBreakpointInfo request." + "description": "An id representing the data. This id is returned from the `dataBreakpointInfo` request." }, "accessType": { "$ref": "#/definitions/DataBreakpointAccessType", @@ -3481,11 +3879,11 @@ }, "condition": { "type": "string", - "description": "An optional expression for conditional breakpoints." + "description": "An expression for conditional breakpoints." }, "hitCondition": { "type": "string", - "description": "An optional expression that controls how many hits of the breakpoint are ignored.\nThe backend is expected to interpret the expression as needed." + "description": "An expression that controls how many hits of the breakpoint are ignored.\nThe debug adapter is expected to interpret the expression as needed." } }, "required": [ "dataId" ] @@ -3493,23 +3891,27 @@ "InstructionBreakpoint": { "type": "object", - "description": "Properties of a breakpoint passed to the setInstructionBreakpoints request", + "description": "Properties of a breakpoint passed to the `setInstructionBreakpoints` request", "properties": { "instructionReference": { "type": "string", - "description": "The instruction reference of the breakpoint.\nThis should be a memory or instruction pointer reference from an EvaluateResponse, Variable, StackFrame, GotoTarget, or Breakpoint." + "description": "The instruction reference of the breakpoint.\nThis should be a memory or instruction pointer reference from an `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or `Breakpoint`." }, "offset": { "type": "integer", - "description": "An optional offset from the instruction reference.\nThis can be negative." + "description": "The offset from the instruction reference in bytes.\nThis can be negative." }, "condition": { "type": "string", - "description": "An optional expression for conditional breakpoints.\nIt is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true." + "description": "An expression for conditional breakpoints.\nIt is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true." }, "hitCondition": { "type": "string", - "description": "An optional expression that controls how many hits of the breakpoint are ignored.\nThe backend is expected to interpret the expression as needed.\nThe attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true." + "description": "An expression that controls how many hits of the breakpoint are ignored.\nThe debug adapter is expected to interpret the expression as needed.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true." + }, + "mode": { + "type": "string", + "description": "The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`." } }, "required": [ "instructionReference" ] @@ -3517,19 +3919,19 @@ "Breakpoint": { "type": "object", - "description": "Information about a Breakpoint created in setBreakpoints, setFunctionBreakpoints, setInstructionBreakpoints, or setDataBreakpoints.", + "description": "Information about a breakpoint created in `setBreakpoints`, `setFunctionBreakpoints`, `setInstructionBreakpoints`, or `setDataBreakpoints` requests.", "properties": { "id": { "type": "integer", - "description": "An optional identifier for the breakpoint. It is needed if breakpoint events are used to update or remove breakpoints." + "description": "The identifier for the breakpoint. It is needed if breakpoint events are used to update or remove breakpoints." }, "verified": { "type": "boolean", - "description": "If true breakpoint could be set (but not necessarily at the desired location)." + "description": "If true, the breakpoint could be set (but not necessarily at the desired location)." }, "message": { "type": "string", - "description": "An optional message about the state of the breakpoint.\nThis is shown to the user and can be used to explain why a breakpoint could not be verified." + "description": "A message about the state of the breakpoint.\nThis is shown to the user and can be used to explain why a breakpoint could not be verified." }, "source": { "$ref": "#/definitions/Source", @@ -3541,23 +3943,28 @@ }, "column": { "type": "integer", - "description": "An optional start column of the actual range covered by the breakpoint." + "description": "Start position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." }, "endLine": { "type": "integer", - "description": "An optional end line of the actual range covered by the breakpoint." + "description": "The end line of the actual range covered by the breakpoint." }, "endColumn": { "type": "integer", - "description": "An optional end column of the actual range covered by the breakpoint.\nIf no end line is given, then the end column is assumed to be in the start line." + "description": "End position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.\nIf no end line is given, then the end column is assumed to be in the start line." }, "instructionReference": { "type": "string", - "description": "An optional memory reference to where the breakpoint is set." + "description": "A memory reference to where the breakpoint is set." }, "offset": { "type": "integer", - "description": "An optional offset from the instruction reference.\nThis can be negative." + "description": "The offset from the instruction reference.\nThis can be negative." + }, + "reason": { + "type": "string", + "description": "A machine-readable explanation of why a breakpoint may not be verified. If a breakpoint is verified or a specific reason is not known, the adapter should omit this property. Possible values include:\n\n- `pending`: Indicates a breakpoint might be verified in the future, but the adapter cannot verify it in the current state.\n - `failed`: Indicates a breakpoint was not able to be verified, and the adapter does not believe it can be verified without intervention.", + "enum": [ "pending", "failed" ] } }, "required": [ "verified" ] @@ -3565,10 +3972,10 @@ "SteppingGranularity": { "type": "string", - "description": "The granularity of one 'step' in the stepping requests 'next', 'stepIn', 'stepOut', and 'stepBack'.", + "description": "The granularity of one 'step' in the stepping requests `next`, `stepIn`, `stepOut`, and `stepBack`.", "enum": [ "statement", "line", "instruction" ], "enumDescriptions": [ - "The step should allow the program to run until the current statement has finished executing.\nThe meaning of a statement is determined by the adapter and it may be considered equivalent to a line.\nFor example 'for(int i = 0; i < 10; i++) could be considered to have 3 statements 'int i = 0', 'i < 10', and 'i++'.", + "The step should allow the program to run until the current statement has finished executing.\nThe meaning of a statement is determined by the adapter and it may be considered equivalent to a line.\nFor example 'for(int i = 0; i < 10; i++)' could be considered to have 3 statements 'int i = 0', 'i < 10', and 'i++'.", "The step should allow the program to run until the current source line has executed.", "The step should allow one instruction to execute (e.g. one x86 instruction)." ] @@ -3576,15 +3983,31 @@ "StepInTarget": { "type": "object", - "description": "A StepInTarget can be used in the 'stepIn' request and determines into which single target the stepIn request should step.", + "description": "A `StepInTarget` can be used in the `stepIn` request and determines into which single target the `stepIn` request should step.", "properties": { "id": { "type": "integer", - "description": "Unique identifier for a stepIn target." + "description": "Unique identifier for a step-in target." }, "label": { "type": "string", - "description": "The name of the stepIn target (shown in the UI)." + "description": "The name of the step-in target (shown in the UI)." + }, + "line": { + "type": "integer", + "description": "The line of the step-in target." + }, + "column": { + "type": "integer", + "description": "Start position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." + }, + "endLine": { + "type": "integer", + "description": "The end line of the range covered by the step-in target." + }, + "endColumn": { + "type": "integer", + "description": "End position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based." } }, "required": [ "id", "label" ] @@ -3592,11 +4015,11 @@ "GotoTarget": { "type": "object", - "description": "A GotoTarget describes a code location that can be used as a target in the 'goto' request.\nThe possible goto targets can be determined via the 'gotoTargets' request.", + "description": "A `GotoTarget` describes a code location that can be used as a target in the `goto` request.\nThe possible goto targets can be determined via the `gotoTargets` request.", "properties": { "id": { "type": "integer", - "description": "Unique identifier for a goto target. This is used in the goto request." + "description": "Unique identifier for a goto target. This is used in the `goto` request." }, "label": { "type": "string", @@ -3608,19 +4031,19 @@ }, "column": { "type": "integer", - "description": "An optional column of the goto target." + "description": "The column of the goto target." }, "endLine": { "type": "integer", - "description": "An optional end line of the range covered by the goto target." + "description": "The end line of the range covered by the goto target." }, "endColumn": { "type": "integer", - "description": "An optional end column of the range covered by the goto target." + "description": "The end column of the range covered by the goto target." }, "instructionPointerReference": { "type": "string", - "description": "Optional memory reference for the instruction pointer value represented by this target." + "description": "A memory reference for the instruction pointer value represented by this target." } }, "required": [ "id", "label", "line" ] @@ -3628,7 +4051,7 @@ "CompletionItem": { "type": "object", - "description": "CompletionItems are the suggestions returned from the CompletionsRequest.", + "description": "`CompletionItems` are the suggestions returned from the `completions` request.", "properties": { "label": { "type": "string", @@ -3636,11 +4059,15 @@ }, "text": { "type": "string", - "description": "If text is not falsy then it is inserted instead of the label." + "description": "If text is returned and not an empty string, then it is inserted instead of the label." }, "sortText": { "type": "string", - "description": "A string that should be used when comparing this item with other items. When `falsy` the label is used." + "description": "A string that should be used when comparing this item with other items. If not returned or an empty string, the `label` is used instead." + }, + "detail": { + "type": "string", + "description": "A human-readable string with additional information about this item, like type or symbol information." }, "type": { "$ref": "#/definitions/CompletionItemType", @@ -3648,19 +4075,19 @@ }, "start": { "type": "integer", - "description": "This value determines the location (in the CompletionsRequest's 'text' attribute) where the completion text is added.\nIf missing the text is added at the location specified by the CompletionsRequest's 'column' attribute." + "description": "Start position (within the `text` attribute of the `completions` request) where the completion text is added. The position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If the start position is omitted the text is added at the location specified by the `column` attribute of the `completions` request." }, "length": { "type": "integer", - "description": "This value determines how many characters are overwritten by the completion text.\nIf missing the value 0 is assumed which results in the completion text being inserted." + "description": "Length determines how many characters are overwritten by the completion text and it is measured in UTF-16 code units. If missing the value 0 is assumed which results in the completion text being inserted." }, "selectionStart": { "type": "integer", - "description": "Determines the start of the new selection after the text has been inserted (or replaced).\nThe start position must in the range 0 and length of the completion text.\nIf omitted the selection starts at the end of the completion text." + "description": "Determines the start of the new selection after the text has been inserted (or replaced). `selectionStart` is measured in UTF-16 code units and must be in the range 0 and length of the completion text. If omitted the selection starts at the end of the completion text." }, "selectionLength": { "type": "integer", - "description": "Determines the length of the new selection after the text has been inserted (or replaced).\nThe selection can not extend beyond the bounds of the completion text.\nIf omitted the length is assumed to be 0." + "description": "Determines the length of the new selection after the text has been inserted (or replaced) and it is measured in UTF-16 code units. The selection can not extend beyond the bounds of the completion text. If omitted the length is assumed to be 0." } }, "required": [ "label" ] @@ -3688,7 +4115,7 @@ }, "checksum": { "type": "string", - "description": "Value of the checksum." + "description": "Value of the checksum, encoded as a hexadecimal value." } }, "required": [ "algorithm", "checksum" ] @@ -3744,15 +4171,19 @@ "ExceptionFilterOptions": { "type": "object", - "description": "An ExceptionFilterOptions is used to specify an exception filter together with a condition for the setExceptionsFilter request.", + "description": "An `ExceptionFilterOptions` is used to specify an exception filter together with a condition for the `setExceptionBreakpoints` request.", "properties": { "filterId": { "type": "string", - "description": "ID of an exception filter returned by the 'exceptionBreakpointFilters' capability." + "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." + "description": "An expression for conditional exceptions.\nThe exception breaks into the debugger if the result of the condition is true." + }, + "mode": { + "type": "string", + "description": "The mode of this exception breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`." } }, "required": [ "filterId" ] @@ -3760,14 +4191,14 @@ "ExceptionOptions": { "type": "object", - "description": "An ExceptionOptions assigns configuration options to a set of exceptions.", + "description": "An `ExceptionOptions` assigns configuration options to a set of exceptions.", "properties": { "path": { "type": "array", "items": { "$ref": "#/definitions/ExceptionPathSegment" }, - "description": "A path that selects a single or multiple exceptions in a tree. If 'path' is missing, the whole tree is selected.\nBy convention the first segment of the path is a category that is used to group exceptions in the UI." + "description": "A path that selects a single or multiple exceptions in a tree. If `path` is missing, the whole tree is selected.\nBy convention the first segment of the path is a category that is used to group exceptions in the UI." }, "breakMode": { "$ref": "#/definitions/ExceptionBreakMode", @@ -3785,7 +4216,7 @@ "ExceptionPathSegment": { "type": "object", - "description": "An ExceptionPathSegment represents a segment in a path that is used to match leafs or nodes in a tree of exceptions.\nIf a segment consists of more than one name, it matches the names provided if 'negate' is false or missing or\nit matches anything except the names provided if 'negate' is true.", + "description": "An `ExceptionPathSegment` represents a segment in a path that is used to match leafs or nodes in a tree of exceptions.\nIf a segment consists of more than one name, it matches the names provided if `negate` is false or missing, or it matches anything except the names provided if `negate` is true.", "properties": { "negate": { "type": "boolean", @@ -3796,7 +4227,7 @@ "items": { "type": "string" }, - "description": "Depending on the value of 'negate' the names that should match or not match." + "description": "Depending on the value of `negate` the names that should match or not match." } }, "required": [ "names" ] @@ -3820,7 +4251,7 @@ }, "evaluateName": { "type": "string", - "description": "Optional expression that can be evaluated in the current scope to obtain the exception object." + "description": "An expression that can be evaluated in the current scope to obtain the exception object." }, "stackTrace": { "type": "string", @@ -3842,11 +4273,11 @@ "properties": { "address": { "type": "string", - "description": "The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise." + "description": "The address of the instruction. Treated as a hex value if prefixed with `0x`, or as a decimal value otherwise." }, "instructionBytes": { "type": "string", - "description": "Optional raw bytes representing the instruction and its operands, in an implementation-defined format." + "description": "Raw bytes representing the instruction and its operands, in an implementation-defined format." }, "instruction": { "type": "string", @@ -3875,6 +4306,11 @@ "endColumn": { "type": "integer", "description": "The end column of the range that corresponds to this instruction, if any." + }, + "presentationHint": { + "type": "string", + "description": "A hint for how to present the instruction in the UI.\n\nA value of `invalid` may be used to indicate this instruction is 'filler' and cannot be reached by the program. For example, unreadable memory addresses may be presented is 'invalid.'", + "enum": [ "normal", "invalid" ] } }, "required": [ "address", "instruction" ] @@ -3882,7 +4318,7 @@ "InvalidatedAreas": { "type": "string", - "description": "Logical areas that can be invalidated by the 'invalidated' event.", + "description": "Logical areas that can be invalidated by the `invalidated` event.", "_enum": [ "all", "stacks", "threads", "variables" ], "enumDescriptions": [ "All previously fetched data has become invalid and needs to be refetched.", @@ -3890,7 +4326,43 @@ "Previously fetched thread related data has become invalid and needs to be refetched.", "Previously fetched variable data has become invalid and needs to be refetched." ] + }, + "BreakpointMode": { + "type": "object", + "description": "A `BreakpointMode` is provided as a option when setting breakpoints on sources or instructions.", + "required": ["mode", "label", "appliesTo"], + "properties": { + "mode": { + "type": "string", + "description": "The internal ID of the mode. This value is passed to the `setBreakpoints` request." + }, + "label": { + "type": "string", + "description": "The name of the breakpoint mode. This is shown in the UI." + }, + "description": { + "type": "string", + "description": "A help text providing additional information about the breakpoint mode. This string is typically shown as a hover and can be translated." + }, + "appliesTo": { + "type": "array", + "items": { + "$ref": "#/definitions/BreakpointModeApplicability" + }, + "description": "Describes one or more type of breakpoint this mode applies to." + } + } + }, + "BreakpointModeApplicability": { + "type": "string", + "_enum": ["source", "exception", "data", "instruction"], + "enumDescriptions": [ + "In `SourceBreakpoint`s", + "In exception breakpoints applied in the `ExceptionFilterOptions`", + "In data breakpoints requested in the `DataBreakpointInfo` request", + "In `InstructionBreakpoint`s" + ], + "description": "Describes one or more type of breakpoint a `BreakpointMode` applies to. This is a non-exhaustive enumeration and may expand as future breakpoint types are added." } - } } diff --git a/scripts/gen_protocol_ml.js b/scripts/gen_protocol.js similarity index 82% rename from scripts/gen_protocol_ml.js rename to scripts/gen_protocol.js index 4ccc79e..dfa6b83 100644 --- a/scripts/gen_protocol_ml.js +++ b/scripts/gen_protocol.js @@ -3,9 +3,28 @@ const yargs = require('yargs/yargs') const { hideBin } = require('yargs/helpers') const argv = yargs(hideBin(process.argv)).argv const _ = require('lodash'); -const hackSchema = require('./hack_schema'); -const schema = hackSchema(JSON.parse(Fs.readFileSync(argv._[0]))); +function hackRestartRequestArguments(schema) { + const args = schema.definitions.RestartArguments; + delete schema.definitions.RestartArguments; + args.properties.arguments = { + type: 'object', + properties: schema.definitions.LaunchRequestArguments.properties + }; + schema.definitions.RestartRequestArguments = args; +} + +function hackSchema(schema) { + schema.definitions.Variable.properties.__vscodeVariableMenuContext = { type: 'string' }; + hackRestartRequestArguments(schema); + return schema; +} + +const arg0 = argv._[0]?.trim(); +if (arg0 !== 'ml' && arg0 !== 'mli') + throw new Error('First argument should be either \'ml\' or \'mli\''); +const mli = arg0 === 'mli'; +const schema = hackSchema(JSON.parse(Fs.readFileSync(argv._[1]))); function resolveDef(def) { if (def != null && def.$ref) { @@ -46,8 +65,12 @@ function emit(str) { emit(`(** ${schema.description} *)\n`); emit(`(* Auto-generated from json schema. Do not edit manually. *)\n\n`); -emit(`open Util\n\n`); -emit(`include Debug_protocol_types\n\n`); +if (mli) { + emit(`include module type of Debug_protocol_types\n\n`); +} else { + emit(`open Util\n\n`); + emit(`include Debug_protocol_types\n\n`); +} const toOcamlName = (() => { function toSnakeCase(key) { @@ -91,7 +114,7 @@ let emitLocalModule = () => { }; function emitModule(emit, modId, f) { - emit(`module ${modId} = struct\n`); + emit(mli ? `module ${modId} : sig\n` : `module ${modId} = struct\n`); const prevEmitLocalModule = emitLocalModule; emitLocalModule = (localModId, f) => { withIndent(emit, (emit) => { @@ -140,6 +163,10 @@ function genType(def, prop, parentDef) { } } + if (mli && def.type == 'object' && def.additionalProperties != null) { + return `String_opt_dict.t`; + } + if (_.isEqual(_.sortBy(def.type), ['integer', 'string'])) { return 'Int_or_string.t'; } @@ -165,7 +192,7 @@ function genType(def, prop, parentDef) { return `${genType(itemType, prop)} list`; } default: - throw new Error('Assertion failed'); + throw new Error(`Unknown type ${def.type}\n${JSON.stringify(def, null, 2)}`); } } @@ -179,15 +206,17 @@ function emitTypeDecl(emit, def, {generic, isEmitTypeModule} = {}) { emit(`type t =`); if (!isEmitTypeModule && Object.entries(types).some(it => it[1] === def)) { const typeName = Object.entries(types).find(it => it[1] === def)[0]; - emit(` ${toOcamlName(typeName)}.t\n`); + emit(mli ? ` ${toOcamlName(typeName)}.t` : ` ${toOcamlName(typeName)}.t\n`); emit(`[@@deriving yojson]`); } else if (def != null && def.type === 'object' && def.additionalProperties != null) { if (_.isEqual(_.sortBy(def.additionalProperties.type), ['null', 'string'])) { emit(` String_opt_dict.t\n`); } else if (def.additionalProperties.type === 'string') { emit(` String_dict.t\n`); + } else if (def.additionalProperties === true) { + emit(` Yojson.Safe.t\n`) } else { - throw new Error('Assertion failed'); + throw new Error(`Unhandled object type\n${JSON.stringify(def, null, 2)}`); } emit(`[@@deriving yojson]`); } else if (def == null || (def.type === 'object' && _.isEmpty(def.properties))) { @@ -269,20 +298,24 @@ function emitTypeDecl(emit, def, {generic, isEmitTypeModule} = {}) { emit(` | Custom of string\n`); } emit(`\n`); - emit(`let of_yojson = function\n`); - for (const str of strs) { - emit(` | \`String "${str}" -> Ok ${toOcamlName(str.replace(/ /g, '_'), true)}\n`); - } - if (isOpen) { - emit(` | \`String str -> Ok (Custom str)`); - } - emit(` | _ -> Error (print_exn_at_loc [%here])\n\n`); - emit(`let to_yojson = function\n`); - for (const str of strs) { - emit(` | ${toOcamlName(str.replace(/ /g, '_'), true)} -> \`String "${str}"\n`); - } - if (isOpen) { - emit(` | Custom str -> \`String str`); + if (mli) { + emit(`include JSONABLE with type t := t`); + } else { + emit(`let of_yojson = function\n`); + for (const str of strs) { + emit(` | \`String "${str}" -> Ok ${toOcamlName(str.replace(/ /g, '_'), true)}\n`); + } + if (isOpen) { + emit(` | \`String str -> Ok (Custom str)`); + } + emit(` | _ -> Error (print_exn_at_loc [%here])\n\n`); + emit(`let to_yojson = function\n`); + for (const str of strs) { + emit(` | ${toOcamlName(str.replace(/ /g, '_'), true)} -> \`String "${str}"\n`); + } + if (isOpen) { + emit(` | Custom str -> \`String str`); + } } } emit(`\n`); @@ -312,7 +345,7 @@ function emitEventModule(event, {doc, body}) { emit('\n'); } emitModule(emit, toOcamlName(`${event}_event`, true), (emit) => { - emit(`let type_ = "${event}"\n`); + emit(mli ? `val type_ : string\n` : `let type_ = "${event}"\n`); emit('\n'); emitModule(emit, toOcamlName('Payload', true), (emit) => { emitTypeDecl(emit, body); @@ -329,7 +362,7 @@ function emitRequestModule(command, {doc, arguments, responseBody}) { emit('\n'); } emitModule(emit, toOcamlName(`${command}_command`, true), (emit) => { - emit(`let type_ = "${command}"\n`); + emit(mli ? `val type_ : string\n` : `let type_ = "${command}"\n`); emit('\n'); emitModule(emit, toOcamlName('Arguments', true), (emit) => { emitTypeDecl(emit, arguments); diff --git a/scripts/gen_protocol_mli.js b/scripts/gen_protocol_mli.js deleted file mode 100644 index 57acaee..0000000 --- a/scripts/gen_protocol_mli.js +++ /dev/null @@ -1,347 +0,0 @@ -const Fs = require('fs'); -const yargs = require('yargs/yargs') -const { hideBin } = require('yargs/helpers') -const argv = yargs(hideBin(process.argv)).argv -const _ = require('lodash'); -const hackSchema = require('./hack_schema'); - -const schema = hackSchema(JSON.parse(Fs.readFileSync(argv._[0]))); - -function resolveDef(def) { - if (def != null && def.$ref) { - return schema.definitions[def.$ref.replace(/^#\/definitions\//, '')]; - } - return def; -} - -const types = {}; -const events = {}; -const requests = {}; - -for (let key of Object.keys(schema.definitions)) { - let def = schema.definitions[key]; - if (key.endsWith('Event') && key !== 'Event') { - const event = key.slice(0, -'Event'.length).replace(/^[A-Z]/, c => c.toLowerCase()); - events[event] = {body: resolveDef((def.allOf[1].properties || {}).body)}; - } else if (key.endsWith('Request') && key !== 'Request') { - const cmd = key.slice(0, -'Request'.length).replace(/^[A-Z]/, c => c.toLowerCase()); - requests[cmd] = requests[cmd] || {}; - requests[cmd].doc = def.allOf[1].description; - requests[cmd].arguments = resolveDef((def.allOf[1].properties || {}).arguments); - } else if (key.endsWith('Response') && key !== 'Response' && key !== 'ErrorResponse') { - const cmd = key.slice(0, -'Response'.length).replace(/^[A-Z]/, c => c.toLowerCase()); - requests[cmd] = requests[cmd] || {}; - requests[cmd].responseBody = resolveDef((def.allOf[1].properties || {}).body); - } else if (key.endsWith('Arguments')) { - // Skip - } else { - types[key] = def; - } -} - -let out = ``; -function emit(str) { - out += str; -} - -emit(`(** ${schema.description} *)\n`); -emit(`(* Auto-generated from json schema. Do not edit manually. *)\n\n`); -emit(`include module type of Debug_protocol_types\n\n`); - -const toOcamlName = (() => { - function toSnakeCase(key) { - return key.replace(/([a-z])([A-Z]+)/g, (m, g1, g2) => `${g1}_${g2.toLowerCase()}`); - } - - function capitalize(key) { - return key.replace(/^[a-z]/, t => t.toUpperCase()); - } - - let KEYWORDS = ["and", "let", "type", "class", "as", "assert", "begin", "class", "constraint", "do", "while", "for", "done", "while", "for", "downto", "for", "else", "if", "end", "exception", "external", "false", "for", "fun", "function", "functor", "if", "in", "let", "include", "inherit", "initializer", "lazy", "let", "match", "method", "module", "mutable", "new", "object", "of", "type", "exception", "open", "or", "private", "rec", "let", "sig", "struct", "then", "if", "to", "for", "true", "try", "type", "val", "virtual", "when", "while", "with", "match", "try"]; - - return (key, makeCap) => { - key = toSnakeCase(key); - if (makeCap) { - key = capitalize(key); - } - if (KEYWORDS.includes(key)) { - key += '_'; - } - return key; - }; -})(); - -function withBuffer(emit, f) { - let buf = ''; - f((str) => { - buf += str; - }); - emit(buf); -} - -function withIndent(emit, f) { - withBuffer((buf) => { - emit(buf.split(/\n/g).map(it => it && ' ' + it).join('\n')); - }, f); -} - -let emitLocalModule = () => { - throw new Error(); -}; - -function emitModule(emit, modId, f) { - emit(`module ${modId} : sig\n`); - const prevEmitLocalModule = emitLocalModule; - emitLocalModule = (modId, f) => { - withIndent(emit, (emit) => { - emitModule(emit, modId, f); - emit('\n'); - }); - }; - withIndent(emit, f); - emitLocalModule = prevEmitLocalModule; - emit(`end\n`); -} - -function genDoc(str) { - return `(** ${str.replace(/([{}\[\]@])/g, '\\$1')} *)`; -} - -let currentTypeModuleName; - -function genType(def, prop, parentDef) { - if (def.allOf != null || def.type === 'object' || !_.isEmpty(def.enum) || !_.isEmpty(def._enum)) { - const entry = Object.entries(types).find(it => it[1] === def); - if (entry != null) { - const modId = toOcamlName(entry[0], true); - emitTypeModule(modId, def); - if (modId === currentTypeModuleName) { - return `t`; - } - return `${modId}.t`; - } else { - const modId = toOcamlName(prop, true); - if (currentTypeModuleName === 'Error_response') { - if (modId === 'Message') { - return 'Response.Message.t'; - } - if (modId === 'Type') { - return 'Response.Type.t'; - } - } - emitLocalModule(modId, (emit) => { - emitTypeDecl(emit, def); - }); - if (modId === currentTypeModuleName) { - return `t`; - } - return `${modId}.t`; - } - } - - - if (def.type == 'object' && def.additionalProperties != null) { - debugger; - return `String_opt_dict.t`; - } - - if (_.isEqual(_.sortBy(def.type), ['integer', 'string'])) { - return 'Int_or_string.t'; - } - - if (_.isEqual(_.sortBy(def.type), ['null', 'string'])) { - return 'string option'; - } - - if (_.isEqual(_.sortBy(def.type), ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string'])) { - if (parentDef.allOf != null && resolveDef(parentDef.allOf[0]) === types.ProtocolMessage) { - return `Yojson.Safe.t`; - } - return 'Any.t'; - } - - switch (def.type) { - case 'string': return 'string'; - case 'boolean': return 'bool'; - case 'integer': return 'int'; - case 'number': return 'float'; - case 'array': { - const itemType = resolveDef(def.items); - return `${genType(itemType, prop)} list`; - } - default: - throw new Error('Assertion failed'); - } -} - -const emittedTypes = new Set(); - -function emitTypeDecl(emit, def, {generic, isEmitTypeModule} = {}) { - if (def != null && def.description) { - emit(genDoc(def.description)); - emit('\n'); - } - emit(`type t =`); - if (!isEmitTypeModule && Object.entries(types).some(it => it[1] === def)) { - const typeName = Object.entries(types).find(it => it[1] === def)[0]; - emit(` ${toOcamlName(typeName)}.t`); - emit(`[@@deriving yojson]`); - } else if (def != null && def.type === 'object' && def.additionalProperties != null) { - if (_.isEqual(_.sortBy(def.additionalProperties.type), ['null', 'string'])) { - emit(` String_opt_dict.t\n`); - } else if (def.additionalProperties.type === 'string') { - emit(` String_dict.t\n`); - } else { - throw new Error('Assertion failed'); - } - emit(`[@@deriving yojson]`); - } else if (def == null || (def.type === 'object' && _.isEmpty(def.properties))) { - emit(` Empty_dict.t\n`); - emit(`[@@deriving yojson]`); - } else if (def.type === 'object' || def.allOf != null) { - let objDef = def; - if (def.allOf != null) { - const merge = (def1, def2) => { - def1 = resolveDef(def1); - def2 = resolveDef(def2); - if (def1.allOf != null) { - def1 = merge(def1.allOf[0], def1.allOf[1]); - } - return { - type: 'object', - properties: { - ...def1.properties, - ...def2.properties, - }, - required: _.union(def1.required, def2.required), - }; - }; - objDef = merge(def.allOf[0], def.allOf[1]); - } - emit(` {\n`); - withIndent(emit, (emit) => { - for (const [prop, propDef0] of Object.entries(objDef.properties || {})) { - const propDef = resolveDef(propDef0); - const mlprop = toOcamlName(prop); - emit(mlprop); - emit(` : `); - const typExp = genType(propDef, prop, def); - emit(typExp); - const isOptional = !(objDef.required || []).includes(prop); - if (isOptional && !typExp.endsWith(' option') && !(generic && ['arguments', 'body'].includes(prop))) { - emit(` option`); - } - if (mlprop !== prop) { - emit(` [@key "${prop}"]`); - } - if (generic && ['arguments', 'body'].includes(prop)) { - emit(` [@default \`Assoc []]`); - } else if (generic && prop === 'type') { - // if (def.allOf[1].properties.event) { - // emit(` [@default Type.Event]`); - // } else if (def.allOf[1].properties.body) { - // emit(` [@default Type.Response]`); - // } else { - // emit(` [@default Type.Request]`); - // } - } else if (isOptional) { - emit(` [@default None]`); - } - emit(`;`); - if (propDef0.description) { - emit(' '); - emit(genDoc(propDef0.description)); - } - emit(`\n`); - } - }); - emit(`}\n`); - emit(`[@@deriving make, yojson {strict = false}]`); - } else if (def.type === 'string' && Array.isArray(def.enum || def._enum)) { - const isOpen = def._enum != null && def.enum == null; - const strs = def.enum || def._enum; - emit(`\n`); - for (const str of strs) { - emit(` | `); - const mlname = toOcamlName(str.replace(/ /g, '_'), true); - emit(mlname); - if (mlname != str) { - emit(` [@name "${str}"]`); - } - emit(`\n`); - } - if (isOpen) { - emit(` | Custom of string\n`); - } - emit(`\n`); - emit(`include JSONABLE with type t := t`); - } - emit(`\n`); -} - -function emitTypeModule(typeName, def) { - if (emittedTypes.has(def)) { - return; - } - emittedTypes.add(def); - const prevTypeModuleName = currentTypeModuleName; - currentTypeModuleName = toOcamlName(typeName); - withBuffer(emit, (emit) => { - const modName = toOcamlName(typeName, true); - emitModule(emit, modName, (emit) => { - emitTypeDecl(emit, def, {generic: ['Event', 'Request', 'Response'].includes(modName), isEmitTypeModule: true}); - }); - emit('\n'); - }); - currentTypeModuleName = prevTypeModuleName; -} - -function emitEventModule(event, {doc, body}) { - withBuffer(emit, (emit) => { - if (doc) { - emit(genDoc(doc)); - emit('\n'); - } - emitModule(emit, toOcamlName(`${event}_event`, true), (emit) => { - emit(`val type_ : string\n`); - emit('\n'); - emitModule(emit, toOcamlName('Payload', true), (emit) => { - emitTypeDecl(emit, body); - }); - }); - emit('\n'); - }); -} - -function emitRequestModule(command, {doc, arguments, responseBody}) { - withBuffer(emit, (emit) => { - if (doc) { - emit(genDoc(doc)); - emit('\n'); - } - emitModule(emit, toOcamlName(`${command}_command`, true), (emit) => { - emit(`val type_ : string\n`); - emit('\n'); - emitModule(emit, toOcamlName('Arguments', true), (emit) => { - emitTypeDecl(emit, arguments); - }); - emit('\n'); - emitModule(emit, toOcamlName('Result', true), (emit) => { - emitTypeDecl(emit, responseBody); - }); - }); - emit('\n'); - }); -} - -for (const [typeName, def] of Object.entries(types)) { - emitTypeModule(typeName, def); -} -for (const [eventType, event] of Object.entries(events)) { - emitEventModule(eventType, event); -} -for (const [command, request] of Object.entries(requests)) { - emitRequestModule(command, request); -} - -process.stdout.write(out); diff --git a/scripts/hack_schema.js b/scripts/hack_schema.js deleted file mode 100644 index df19861..0000000 --- a/scripts/hack_schema.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = hackSchema; - -function hackSchema(schema) { - schema.definitions.Variable.properties.__vscodeVariableMenuContext = { type: 'string' }; - return schema; -} diff --git a/src/debug_protocol/debug_protocol.ml b/src/debug_protocol/debug_protocol.ml index 50127fa..5182b52 100644 --- a/src/debug_protocol/debug_protocol.ml +++ b/src/debug_protocol/debug_protocol.ml @@ -29,7 +29,7 @@ module Protocol_message = struct (** Base class of requests, responses, and events. *) type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Type.t [@key "type"]; (** Message type. *) } [@@deriving make, yojson {strict = false}] @@ -50,7 +50,7 @@ module Request = struct end type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Type.t [@key "type"]; command : string; (** The command to execute. *) arguments : Yojson.Safe.t [@default `Assoc []]; (** Object containing arguments for the command. *) @@ -73,7 +73,7 @@ module Event = struct end type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Type.t [@key "type"]; event : string; (** Type of event. *) body : Yojson.Safe.t [@default `Assoc []]; (** Event-specific information. *) @@ -96,34 +96,37 @@ module Response = struct end module Message = struct - (** Contains the raw error in short form if 'success' is false. - This raw error might be interpreted by the frontend and is not shown in the UI. + (** Contains the raw error in short form if `success` is false. + This raw error might be interpreted by the client and is not shown in the UI. Some predefined values exist. *) type t = | Cancelled [@name "cancelled"] + | Not_stopped [@name "notStopped"] | Custom of string let of_yojson = function | `String "cancelled" -> Ok Cancelled + | `String "notStopped" -> Ok Not_stopped | `String str -> Ok (Custom str) | _ -> Error (print_exn_at_loc [%here]) let to_yojson = function | Cancelled -> `String "cancelled" + | Not_stopped -> `String "notStopped" | Custom str -> `String str end type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Type.t [@key "type"]; request_seq : int; (** Sequence number of the corresponding request. *) success : bool; (** Outcome of the request. - If true, the request was successful and the 'body' attribute may contain the result of the request. - If the value is false, the attribute 'message' contains the error in short form and the 'body' may contain additional information (see 'ErrorResponse.body.error'). *) + If true, the request was successful and the `body` attribute may contain the result of the request. + If the value is false, the attribute `message` contains the error in short form and the `body` may contain additional information (see `ErrorResponse.body.error`). *) command : string; (** The command requested. *) - message : Message.t option [@default None]; (** Contains the raw error in short form if 'success' is false. - This raw error might be interpreted by the frontend and is not shown in the UI. + message : Message.t option [@default None]; (** Contains the raw error in short form if `success` is false. + This raw error might be interpreted by the client and is not shown in the UI. Some predefined values exist. *) - body : Yojson.Safe.t [@default `Assoc []]; (** Contains request result if success is true and optional error details if success is false. *) + body : Yojson.Safe.t [@default `Assoc []]; (** Contains request result if success is true and error details if success is false. *) } [@@deriving make, yojson {strict = false}] end @@ -137,14 +140,14 @@ module Message = struct (** A structured message object. Used to return errors from requests. *) type t = { - id : int; (** Unique identifier for the message. *) - format : string; (** A format string for the message. Embedded variables have the form '\{name\}'. + id : int; (** Unique (within a debug adapter implementation) identifier for the message. The purpose of these error IDs is to help extension authors that have the requirement that every user visible error message needs a corresponding error number, so that users or customer support can find information about the specific error more easily. *) + format : string; (** A format string for the message. Embedded variables have the form `\{name\}`. If variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes. *) variables : Variables.t option [@default None]; (** An object used as a dictionary for looking up the variables in the format string. *) send_telemetry : bool option [@key "sendTelemetry"] [@default None]; (** If true send to telemetry. *) show_user : bool option [@key "showUser"] [@default None]; (** If true show user. *) - url : string option [@default None]; (** An optional url where additional information about this message can be found. *) - url_label : string option [@key "urlLabel"] [@default None]; (** An optional label that is presented to the user as the UI for opening the url. *) + url : string option [@default None]; (** A url where additional information about this message can be found. *) + url_label : string option [@key "urlLabel"] [@default None]; (** A label that is presented to the user as the UI for opening the url. *) } [@@deriving make, yojson {strict = false}] end @@ -152,21 +155,21 @@ end module Error_response = struct module Body = struct type t = { - error : Message.t option [@default None]; (** An optional, structured error message. *) + error : Message.t option [@default None]; (** A structured error message. *) } [@@deriving make, yojson {strict = false}] end type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Response.Type.t [@key "type"]; request_seq : int; (** Sequence number of the corresponding request. *) success : bool; (** Outcome of the request. - If true, the request was successful and the 'body' attribute may contain the result of the request. - If the value is false, the attribute 'message' contains the error in short form and the 'body' may contain additional information (see 'ErrorResponse.body.error'). *) + If true, the request was successful and the `body` attribute may contain the result of the request. + If the value is false, the attribute `message` contains the error in short form and the `body` may contain additional information (see `ErrorResponse.body.error`). *) command : string; (** The command requested. *) - message : Response.Message.t option [@default None]; (** Contains the raw error in short form if 'success' is false. - This raw error might be interpreted by the frontend and is not shown in the UI. + message : Response.Message.t option [@default None]; (** Contains the raw error in short form if `success` is false. + This raw error might be interpreted by the client and is not shown in the UI. Some predefined values exist. *) body : Body.t; } @@ -174,19 +177,21 @@ module Error_response = struct end module Exception_breakpoints_filter = struct - (** An ExceptionBreakpointsFilter is shown in the UI as an filter option for configuring how exceptions are dealt with. *) + (** An `ExceptionBreakpointsFilter` is shown in the UI as an filter option for configuring how exceptions are dealt with. *) type t = { - filter : string; (** The internal ID of the filter option. This value is passed to the 'setExceptionBreakpoints' request. *) - label : string; (** The name of the filter option. This will be shown in the UI. *) - default : bool option [@default None]; (** Initial value of the filter option. If not specified a value 'false' is assumed. *) + filter : string; (** The internal ID of the filter option. This value is passed to the `setExceptionBreakpoints` request. *) + label : string; (** The name of the filter option. This is shown in the UI. *) + description : string option [@default None]; (** A help text providing additional information about the exception filter. This string is typically shown as a hover and can be translated. *) + default : bool option [@default None]; (** Initial value of the filter option. If not specified a value false is assumed. *) supports_condition : bool option [@key "supportsCondition"] [@default None]; (** Controls whether a condition can be specified for this filter option. If false or missing, a condition can not be set. *) + condition_description : string option [@key "conditionDescription"] [@default None]; (** A help text providing information about the condition. This string is shown as the placeholder text for a text box and can be translated. *) } [@@deriving make, yojson {strict = false}] end module Column_descriptor = struct module Type = struct - (** Datatype of values in this column. Defaults to 'string' if not specified. *) + (** Datatype of values in this column. Defaults to `string` if not specified. *) type t = | String [@name "string"] | Number [@name "number"] @@ -208,14 +213,14 @@ module Column_descriptor = struct end - (** A ColumnDescriptor specifies what module attribute to show in a column of the ModulesView, how to format it, + (** A `ColumnDescriptor` specifies what module attribute to show in a column of the modules view, how to format it, and what the column's label should be. It is only used if the underlying UI actually supports this level of customization. *) type t = { attribute_name : string [@key "attributeName"]; (** Name of the attribute rendered in this column. *) label : string; (** Header UI label of column. *) format : string option [@default None]; (** Format to use for the rendered values in this column. TBD how the format strings looks like. *) - type_ : Type.t option [@key "type"] [@default None]; (** Datatype of values in this column. Defaults to 'string' if not specified. *) + type_ : Type.t option [@key "type"] [@default None]; (** Datatype of values in this column. Defaults to `string` if not specified. *) width : int option [@default None]; (** Width of this column in characters (hint only). *) } [@@deriving make, yojson {strict = false}] @@ -244,90 +249,120 @@ module Checksum_algorithm = struct end +module Breakpoint_mode_applicability = struct + (** Describes one or more type of breakpoint a `BreakpointMode` applies to. This is a non-exhaustive enumeration and may expand as future breakpoint types are added. *) + type t = + | Source [@name "source"] + | Exception [@name "exception"] + | Data [@name "data"] + | Instruction [@name "instruction"] + | Custom of string + + let of_yojson = function + | `String "source" -> Ok Source + | `String "exception" -> Ok Exception + | `String "data" -> Ok Data + | `String "instruction" -> Ok Instruction + | `String str -> Ok (Custom str) | _ -> Error (print_exn_at_loc [%here]) + + let to_yojson = function + | Source -> `String "source" + | Exception -> `String "exception" + | Data -> `String "data" + | Instruction -> `String "instruction" + | Custom str -> `String str +end + +module Breakpoint_mode = struct + (** A `BreakpointMode` is provided as a option when setting breakpoints on sources or instructions. *) + type t = { + mode : string; (** The internal ID of the mode. This value is passed to the `setBreakpoints` request. *) + label : string; (** The name of the breakpoint mode. This is shown in the UI. *) + description : string option [@default None]; (** A help text providing additional information about the breakpoint mode. This string is typically shown as a hover and can be translated. *) + applies_to : Breakpoint_mode_applicability.t list [@key "appliesTo"]; (** Describes one or more type of breakpoint this mode applies to. *) + } + [@@deriving make, yojson {strict = false}] +end + module Capabilities = struct (** Information about the capabilities of a debug adapter. *) type t = { - supports_configuration_done_request : bool option [@key "supportsConfigurationDoneRequest"] [@default None]; (** The debug adapter supports the 'configurationDone' request. *) + supports_configuration_done_request : bool option [@key "supportsConfigurationDoneRequest"] [@default None]; (** The debug adapter supports the `configurationDone` request. *) supports_function_breakpoints : bool option [@key "supportsFunctionBreakpoints"] [@default None]; (** The debug adapter supports function breakpoints. *) supports_conditional_breakpoints : bool option [@key "supportsConditionalBreakpoints"] [@default None]; (** The debug adapter supports conditional breakpoints. *) supports_hit_conditional_breakpoints : bool option [@key "supportsHitConditionalBreakpoints"] [@default None]; (** The debug adapter supports breakpoints that break execution after a specified number of hits. *) - supports_evaluate_for_hovers : bool option [@key "supportsEvaluateForHovers"] [@default None]; (** The debug adapter supports a (side effect free) evaluate request for data hovers. *) - exception_breakpoint_filters : Exception_breakpoints_filter.t list option [@key "exceptionBreakpointFilters"] [@default None]; (** Available exception filter options for the 'setExceptionBreakpoints' request. *) - supports_step_back : bool option [@key "supportsStepBack"] [@default None]; (** The debug adapter supports stepping back via the 'stepBack' and 'reverseContinue' requests. *) + supports_evaluate_for_hovers : bool option [@key "supportsEvaluateForHovers"] [@default None]; (** The debug adapter supports a (side effect free) `evaluate` request for data hovers. *) + exception_breakpoint_filters : Exception_breakpoints_filter.t list option [@key "exceptionBreakpointFilters"] [@default None]; (** Available exception filter options for the `setExceptionBreakpoints` request. *) + supports_step_back : bool option [@key "supportsStepBack"] [@default None]; (** The debug adapter supports stepping back via the `stepBack` and `reverseContinue` requests. *) supports_set_variable : bool option [@key "supportsSetVariable"] [@default None]; (** The debug adapter supports setting a variable to a value. *) supports_restart_frame : bool option [@key "supportsRestartFrame"] [@default None]; (** The debug adapter supports restarting a frame. *) - supports_goto_targets_request : bool option [@key "supportsGotoTargetsRequest"] [@default None]; (** The debug adapter supports the 'gotoTargets' request. *) - supports_step_in_targets_request : bool option [@key "supportsStepInTargetsRequest"] [@default None]; (** The debug adapter supports the 'stepInTargets' request. *) - supports_completions_request : bool option [@key "supportsCompletionsRequest"] [@default None]; (** The debug adapter supports the 'completions' request. *) - completion_trigger_characters : string list option [@key "completionTriggerCharacters"] [@default None]; (** The set of characters that should trigger completion in a REPL. If not specified, the UI should assume the '.' character. *) - supports_modules_request : bool option [@key "supportsModulesRequest"] [@default None]; (** The debug adapter supports the 'modules' request. *) + supports_goto_targets_request : bool option [@key "supportsGotoTargetsRequest"] [@default None]; (** The debug adapter supports the `gotoTargets` request. *) + supports_step_in_targets_request : bool option [@key "supportsStepInTargetsRequest"] [@default None]; (** The debug adapter supports the `stepInTargets` request. *) + supports_completions_request : bool option [@key "supportsCompletionsRequest"] [@default None]; (** The debug adapter supports the `completions` request. *) + completion_trigger_characters : string list option [@key "completionTriggerCharacters"] [@default None]; (** The set of characters that should trigger completion in a REPL. If not specified, the UI should assume the `.` character. *) + supports_modules_request : bool option [@key "supportsModulesRequest"] [@default None]; (** The debug adapter supports the `modules` request. *) additional_module_columns : Column_descriptor.t list option [@key "additionalModuleColumns"] [@default None]; (** The set of additional module information exposed by the debug adapter. *) supported_checksum_algorithms : Checksum_algorithm.t list option [@key "supportedChecksumAlgorithms"] [@default None]; (** Checksum algorithms supported by the debug adapter. *) - supports_restart_request : bool option [@key "supportsRestartRequest"] [@default None]; (** The debug adapter supports the 'restart' request. In this case a client should not implement 'restart' by terminating and relaunching the adapter but by calling the RestartRequest. *) - supports_exception_options : bool option [@key "supportsExceptionOptions"] [@default None]; (** The debug adapter supports 'exceptionOptions' on the setExceptionBreakpoints request. *) - supports_value_formatting_options : bool option [@key "supportsValueFormattingOptions"] [@default None]; (** The debug adapter supports a 'format' attribute on the stackTraceRequest, variablesRequest, and evaluateRequest. *) - supports_exception_info_request : bool option [@key "supportsExceptionInfoRequest"] [@default None]; (** The debug adapter supports the 'exceptionInfo' request. *) - support_terminate_debuggee : bool option [@key "supportTerminateDebuggee"] [@default None]; (** The debug adapter supports the 'terminateDebuggee' attribute on the 'disconnect' request. *) - supports_delayed_stack_trace_loading : bool option [@key "supportsDelayedStackTraceLoading"] [@default None]; (** The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and an optional 'totalFrames' result of the 'StackTrace' request are supported. *) - supports_loaded_sources_request : bool option [@key "supportsLoadedSourcesRequest"] [@default None]; (** The debug adapter supports the 'loadedSources' request. *) - supports_log_points : bool option [@key "supportsLogPoints"] [@default None]; (** The debug adapter supports logpoints by interpreting the 'logMessage' attribute of the SourceBreakpoint. *) - supports_terminate_threads_request : bool option [@key "supportsTerminateThreadsRequest"] [@default None]; (** The debug adapter supports the 'terminateThreads' request. *) - supports_set_expression : bool option [@key "supportsSetExpression"] [@default None]; (** The debug adapter supports the 'setExpression' request. *) - supports_terminate_request : bool option [@key "supportsTerminateRequest"] [@default None]; (** The debug adapter supports the 'terminate' request. *) + supports_restart_request : bool option [@key "supportsRestartRequest"] [@default None]; (** The debug adapter supports the `restart` request. In this case a client should not implement `restart` by terminating and relaunching the adapter but by calling the `restart` request. *) + supports_exception_options : bool option [@key "supportsExceptionOptions"] [@default None]; (** The debug adapter supports `exceptionOptions` on the `setExceptionBreakpoints` request. *) + supports_value_formatting_options : bool option [@key "supportsValueFormattingOptions"] [@default None]; (** The debug adapter supports a `format` attribute on the `stackTrace`, `variables`, and `evaluate` requests. *) + supports_exception_info_request : bool option [@key "supportsExceptionInfoRequest"] [@default None]; (** The debug adapter supports the `exceptionInfo` request. *) + support_terminate_debuggee : bool option [@key "supportTerminateDebuggee"] [@default None]; (** The debug adapter supports the `terminateDebuggee` attribute on the `disconnect` request. *) + support_suspend_debuggee : bool option [@key "supportSuspendDebuggee"] [@default None]; (** The debug adapter supports the `suspendDebuggee` attribute on the `disconnect` request. *) + supports_delayed_stack_trace_loading : bool option [@key "supportsDelayedStackTraceLoading"] [@default None]; (** The debug adapter supports the delayed loading of parts of the stack, which requires that both the `startFrame` and `levels` arguments and the `totalFrames` result of the `stackTrace` request are supported. *) + supports_loaded_sources_request : bool option [@key "supportsLoadedSourcesRequest"] [@default None]; (** The debug adapter supports the `loadedSources` request. *) + supports_log_points : bool option [@key "supportsLogPoints"] [@default None]; (** The debug adapter supports log points by interpreting the `logMessage` attribute of the `SourceBreakpoint`. *) + supports_terminate_threads_request : bool option [@key "supportsTerminateThreadsRequest"] [@default None]; (** The debug adapter supports the `terminateThreads` request. *) + supports_set_expression : bool option [@key "supportsSetExpression"] [@default None]; (** The debug adapter supports the `setExpression` request. *) + supports_terminate_request : bool option [@key "supportsTerminateRequest"] [@default None]; (** The debug adapter supports the `terminate` request. *) supports_data_breakpoints : bool option [@key "supportsDataBreakpoints"] [@default None]; (** The debug adapter supports data breakpoints. *) - supports_read_memory_request : bool option [@key "supportsReadMemoryRequest"] [@default None]; (** The debug adapter supports the 'readMemory' request. *) - supports_disassemble_request : bool option [@key "supportsDisassembleRequest"] [@default None]; (** The debug adapter supports the 'disassemble' request. *) - supports_cancel_request : bool option [@key "supportsCancelRequest"] [@default None]; (** The debug adapter supports the 'cancel' request. *) - supports_breakpoint_locations_request : bool option [@key "supportsBreakpointLocationsRequest"] [@default None]; (** The debug adapter supports the 'breakpointLocations' request. *) - supports_clipboard_context : bool option [@key "supportsClipboardContext"] [@default None]; (** The debug adapter supports the 'clipboard' context value in the 'evaluate' request. *) - supports_stepping_granularity : bool option [@key "supportsSteppingGranularity"] [@default None]; (** The debug adapter supports stepping granularities (argument 'granularity') for the stepping requests. *) + supports_read_memory_request : bool option [@key "supportsReadMemoryRequest"] [@default None]; (** The debug adapter supports the `readMemory` request. *) + supports_write_memory_request : bool option [@key "supportsWriteMemoryRequest"] [@default None]; (** The debug adapter supports the `writeMemory` request. *) + supports_disassemble_request : bool option [@key "supportsDisassembleRequest"] [@default None]; (** The debug adapter supports the `disassemble` request. *) + supports_cancel_request : bool option [@key "supportsCancelRequest"] [@default None]; (** The debug adapter supports the `cancel` request. *) + supports_breakpoint_locations_request : bool option [@key "supportsBreakpointLocationsRequest"] [@default None]; (** The debug adapter supports the `breakpointLocations` request. *) + supports_clipboard_context : bool option [@key "supportsClipboardContext"] [@default None]; (** The debug adapter supports the `clipboard` context value in the `evaluate` request. *) + supports_stepping_granularity : bool option [@key "supportsSteppingGranularity"] [@default None]; (** The debug adapter supports stepping granularities (argument `granularity`) for the stepping requests. *) supports_instruction_breakpoints : bool option [@key "supportsInstructionBreakpoints"] [@default None]; (** The debug adapter supports adding breakpoints based on instruction references. *) - supports_exception_filter_options : bool option [@key "supportsExceptionFilterOptions"] [@default None]; (** The debug adapter supports 'filterOptions' as an argument on the 'setExceptionBreakpoints' request. *) + supports_exception_filter_options : bool option [@key "supportsExceptionFilterOptions"] [@default None]; (** The debug adapter supports `filterOptions` as an argument on the `setExceptionBreakpoints` request. *) + supports_single_thread_execution_requests : bool option [@key "supportsSingleThreadExecutionRequests"] [@default None]; (** The debug adapter supports the `singleThread` property on the execution requests (`continue`, `next`, `stepIn`, `stepOut`, `reverseContinue`, `stepBack`). *) + supports_data_breakpoint_bytes : bool option [@key "supportsDataBreakpointBytes"] [@default None]; (** The debug adapter supports the `asAddress` and `bytes` fields in the `dataBreakpointInfo` request. *) + breakpoint_modes : Breakpoint_mode.t list option [@key "breakpointModes"] [@default None]; (** Modes of breakpoints supported by the debug adapter, such as 'hardware' or 'software'. If present, the client may allow the user to select a mode and include it in its `setBreakpoints` request. + + Clients may present the first applicable mode in this array as the 'default' mode in gestures that set breakpoints. *) + supports_ansistyling : bool option [@key "supportsANSIStyling"] [@default None]; (** The debug adapter supports ANSI escape sequences in styling of `OutputEvent.output` and `Variable.value` fields. *) } [@@deriving make, yojson {strict = false}] end module Module = struct (** A Module object represents a row in the modules view. - Two attributes are mandatory: an id identifies a module in the modules view and is used in a ModuleEvent for identifying a module for adding, updating or deleting. - The name is used to minimally render the module in the UI. + The `id` attribute identifies a module in the modules view and is used in a `module` event for identifying a module for adding, updating or deleting. + The `name` attribute is used to minimally render the module in the UI. - Additional attributes can be added to the module. They will show up in the module View if they have a corresponding ColumnDescriptor. + Additional attributes can be added to the module. They show up in the module view if they have a corresponding `ColumnDescriptor`. - To avoid an unnecessary proliferation of additional attributes with similar semantics but different names - we recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found. *) + To avoid an unnecessary proliferation of additional attributes with similar semantics but different names, we recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found. *) type t = { id : Int_or_string.t; (** Unique identifier for the module. *) name : string; (** A name of the module. *) - path : string option [@default None]; (** optional but recommended attributes. - always try to use these first before introducing additional attributes. - - Logical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module. *) + path : string option [@default None]; (** Logical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module. *) is_optimized : bool option [@key "isOptimized"] [@default None]; (** True if the module is optimized. *) is_user_code : bool option [@key "isUserCode"] [@default None]; (** True if the module is considered 'user code' by a debugger that supports 'Just My Code'. *) version : string option [@default None]; (** Version of Module. *) - symbol_status : string option [@key "symbolStatus"] [@default None]; (** User understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc. *) + symbol_status : string option [@key "symbolStatus"] [@default None]; (** User-understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc.) *) symbol_file_path : string option [@key "symbolFilePath"] [@default None]; (** Logical full path to the symbol file. The exact definition is implementation defined. *) - date_time_stamp : string option [@key "dateTimeStamp"] [@default None]; (** Module created or modified. *) + date_time_stamp : string option [@key "dateTimeStamp"] [@default None]; (** Module created or modified, encoded as a RFC 3339 timestamp. *) address_range : string option [@key "addressRange"] [@default None]; (** Address range covered by this module. *) } [@@deriving make, yojson {strict = false}] end -module Modules_view_descriptor = struct - (** The ModulesViewDescriptor is the container for all declarative configuration options of a ModuleView. - For now it only specifies the columns to be shown in the modules view. *) - type t = { - columns : Column_descriptor.t list; - } - [@@deriving make, yojson {strict = false}] -end - module Thread = struct (** A Thread *) type t = { id : int; (** Unique identifier for the thread. *) - name : string; (** A name of the thread. *) + name : string; (** The name of the thread. *) } [@@deriving make, yojson {strict = false}] end @@ -336,15 +371,15 @@ module Checksum = struct (** The checksum of an item calculated by the specified algorithm. *) type t = { algorithm : Checksum_algorithm.t; (** The algorithm used to calculate this checksum. *) - checksum : string; (** Value of the checksum. *) + checksum : string; (** Value of the checksum, encoded as a hexadecimal value. *) } [@@deriving make, yojson {strict = false}] end module Source = struct module Presentation_hint = struct - (** An optional hint for how to present the source in the UI. - A value of 'deemphasize' can be used to indicate that the source is not available or that it is skipped on stepping. *) + (** A hint for how to present the source in the UI. + A value of `deemphasize` can be used to indicate that the source is not available or that it is skipped on stepping. *) type t = | Normal [@name "normal"] | Emphasize [@name "emphasize"] @@ -363,21 +398,21 @@ module Source = struct end - (** A Source is a descriptor for source code. - It is returned from the debug adapter as part of a StackFrame and it is used by clients when specifying breakpoints. *) + (** A `Source` is a descriptor for source code. + It is returned from the debug adapter as part of a `StackFrame` and it is used by clients when specifying breakpoints. *) type t = { name : string option [@default None]; (** The short name of the source. Every source returned from the debug adapter has a name. When sending a source to the debug adapter this name is optional. *) path : string option [@default None]; (** The path of the source to be shown in the UI. - It is only used to locate and load the content of the source if no sourceReference is specified (or its value is 0). *) - source_reference : int option [@key "sourceReference"] [@default None]; (** If sourceReference > 0 the contents of the source must be retrieved through the SourceRequest (even if a path is specified). - A sourceReference is only valid for a session, so it must not be used to persist a source. + It is only used to locate and load the content of the source if no `sourceReference` is specified (or its value is 0). *) + source_reference : int option [@key "sourceReference"] [@default None]; (** If the value > 0 the contents of the source must be retrieved through the `source` request (even if a path is specified). + Since a `sourceReference` is only valid for a session, it can not be used to persist a source. The value should be less than or equal to 2147483647 (2^31-1). *) - presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** An optional hint for how to present the source in the UI. - A value of 'deemphasize' can be used to indicate that the source is not available or that it is skipped on stepping. *) - origin : string option [@default None]; (** The (optional) origin of this source: possible values 'internal module', 'inlined content from source map', etc. *) - sources : t list option [@default None]; (** An optional list of sources that are related to this source. These may be the source that generated this source. *) - adapter_data : Any.t option [@key "adapterData"] [@default None]; (** Optional data that a debug adapter might want to loop through the client. + presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** A hint for how to present the source in the UI. + A value of `deemphasize` can be used to indicate that the source is not available or that it is skipped on stepping. *) + origin : string option [@default None]; (** The origin of this source. For example, 'internal module', 'inlined content from source map', etc. *) + sources : t list option [@default None]; (** A list of sources that are related to this source. These may be the source that generated this source. *) + adapter_data : Any.t option [@key "adapterData"] [@default None]; (** Additional data that a debug adapter might want to loop through the client. The client should leave the data intact and persist it across sessions. The client should not interpret the data. *) checksums : Checksum.t list option [@default None]; (** The checksums associated with this file. *) } @@ -386,8 +421,8 @@ end module Stack_frame = struct module Presentation_hint = struct - (** An optional hint for how to present this frame in the UI. - A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way. *) + (** A hint for how to present this frame in the UI. + A value of `label` can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of `subtle` can be used to change the appearance of a frame in a 'subtle' way. *) type t = | Normal [@name "normal"] | Label [@name "label"] @@ -409,58 +444,62 @@ module Stack_frame = struct (** A Stackframe contains the source location. *) type t = { id : int; (** An identifier for the stack frame. It must be unique across all threads. - This id can be used to retrieve the scopes of the frame with the 'scopesRequest' or to restart the execution of a stackframe. *) + This id can be used to retrieve the scopes of the frame with the `scopes` request or to restart the execution of a stack frame. *) name : string; (** The name of the stack frame, typically a method name. *) - source : Source.t option [@default None]; (** The optional source of the frame. *) - line : int; (** The line within the file of the frame. If source is null or doesn't exist, line is 0 and must be ignored. *) - column : int; (** The column within the line. If source is null or doesn't exist, column is 0 and must be ignored. *) - end_line : int option [@key "endLine"] [@default None]; (** An optional end line of the range covered by the stack frame. *) - end_column : int option [@key "endColumn"] [@default None]; (** An optional end column of the range covered by the stack frame. *) - instruction_pointer_reference : string option [@key "instructionPointerReference"] [@default None]; (** Optional memory reference for the current instruction pointer in this frame. *) + source : Source.t option [@default None]; (** The source of the frame. *) + line : int; (** The line within the source of the frame. If the source attribute is missing or doesn't exist, `line` is 0 and should be ignored by the client. *) + column : int; (** Start position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If attribute `source` is missing or doesn't exist, `column` is 0 and should be ignored by the client. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the range covered by the stack frame. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + can_restart : bool option [@key "canRestart"] [@default None]; (** Indicates whether this frame can be restarted with the `restartFrame` request. Clients should only use this if the debug adapter supports the `restart` request and the corresponding capability `supportsRestartFrame` is true. If a debug adapter has this capability, then `canRestart` defaults to `true` if the property is absent. *) + instruction_pointer_reference : string option [@key "instructionPointerReference"] [@default None]; (** A memory reference for the current instruction pointer in this frame. *) module_id : Int_or_string.t option [@key "moduleId"] [@default None]; (** The module associated with this frame, if any. *) - presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** An optional hint for how to present this frame in the UI. - A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way. *) + presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** A hint for how to present this frame in the UI. + A value of `label` can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of `subtle` can be used to change the appearance of a frame in a 'subtle' way. *) } [@@deriving make, yojson {strict = false}] end module Scope = struct module Presentation_hint = struct - (** An optional hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI. *) + (** A hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI. *) type t = | Arguments [@name "arguments"] | Locals [@name "locals"] | Registers [@name "registers"] + | Return_value [@name "returnValue"] | Custom of string let of_yojson = function | `String "arguments" -> Ok Arguments | `String "locals" -> Ok Locals | `String "registers" -> Ok Registers + | `String "returnValue" -> Ok Return_value | `String str -> Ok (Custom str) | _ -> Error (print_exn_at_loc [%here]) let to_yojson = function | Arguments -> `String "arguments" | Locals -> `String "locals" | Registers -> `String "registers" + | Return_value -> `String "returnValue" | Custom str -> `String str end - (** A Scope is a named container for variables. Optionally a scope can map to a source or a range within a source. *) + (** A `Scope` is a named container for variables. Optionally a scope can map to a source or a range within a source. *) type t = { name : string; (** Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This string is shown in the UI as is and can be translated. *) - presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** An optional hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI. *) - variables_reference : int [@key "variablesReference"]; (** The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest. *) + presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** A hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI. *) + variables_reference : int [@key "variablesReference"]; (** The variables of this scope can be retrieved by passing the value of `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) named_variables : int option [@key "namedVariables"] [@default None]; (** 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. *) + The client can use this information to present the variables in a paged UI and fetch them in chunks. *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** 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. *) + The client can use this information to present the variables in a paged UI and fetch them in chunks. *) expensive : bool; (** If true, the number of variables in this scope is large or expensive to retrieve. *) - source : Source.t option [@default None]; (** Optional source for this scope. *) - line : int option [@default None]; (** Optional start line of the range covered by this scope. *) - column : int option [@default None]; (** Optional start column of the range covered by this scope. *) - end_line : int option [@key "endLine"] [@default None]; (** Optional end line of the range covered by this scope. *) - end_column : int option [@key "endColumn"] [@default None]; (** Optional end column of the range covered by this scope. *) + source : Source.t option [@default None]; (** The source for this scope. *) + line : int option [@default None]; (** The start line of the range covered by this scope. *) + column : int option [@default None]; (** Start position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the range covered by this scope. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) } [@@deriving make, yojson {strict = false}] end @@ -520,6 +559,7 @@ module Variable_presentation_hint = struct | Has_object_id [@name "hasObjectId"] | Can_have_object_id [@name "canHaveObjectId"] | Has_side_effects [@name "hasSideEffects"] + | Has_data_breakpoint [@name "hasDataBreakpoint"] | Custom of string let of_yojson = function @@ -530,6 +570,7 @@ module Variable_presentation_hint = struct | `String "hasObjectId" -> Ok Has_object_id | `String "canHaveObjectId" -> Ok Can_have_object_id | `String "hasSideEffects" -> Ok Has_side_effects + | `String "hasDataBreakpoint" -> Ok Has_data_breakpoint | `String str -> Ok (Custom str) | _ -> Error (print_exn_at_loc [%here]) let to_yojson = function @@ -540,6 +581,7 @@ module Variable_presentation_hint = struct | Has_object_id -> `String "hasObjectId" | Can_have_object_id -> `String "canHaveObjectId" | Has_side_effects -> `String "hasSideEffects" + | Has_data_breakpoint -> `String "hasDataBreakpoint" | Custom str -> `String str end @@ -570,78 +612,95 @@ module Variable_presentation_hint = struct | Custom str -> `String str end - (** Optional properties of a variable that can be used to determine how to render the variable in the UI. *) + (** Properties of a variable that can be used to determine how to render the variable in the UI. *) type t = { kind : Kind.t option [@default None]; (** The kind of variable. Before introducing additional values, try to use the listed values. *) attributes : Attributes.t list option [@default None]; (** Set of attributes represented as an array of strings. Before introducing additional values, try to use the listed values. *) visibility : Visibility.t option [@default None]; (** Visibility of variable. Before introducing additional values, try to use the listed values. *) + lazy_ : bool option [@key "lazy"] [@default None]; (** If true, clients can present the variable with a UI that supports a specific gesture to trigger its evaluation. + This mechanism can be used for properties that require executing code when retrieving their value and where the code execution can be expensive and/or produce side-effects. A typical example are properties based on a getter function. + Please note that in addition to the `lazy` flag, the variable's `variablesReference` is expected to refer to a variable that will provide the value through another `variable` request. *) } [@@deriving make, yojson {strict = false}] end module Variable = struct (** A Variable is a name/value pair. - Optionally a variable can have a 'type' that is shown if space permits or when hovering over the variable's name. - An optional 'kind' is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private. - If the value is structured (has children), a handle is provided to retrieve the children with the VariablesRequest. - If the number of named or indexed children is large, the numbers should be returned via the optional 'namedVariables' and 'indexedVariables' attributes. - The client can use this optional information to present the children in a paged UI and fetch them in chunks. *) + The `type` attribute is shown if space permits or when hovering over the variable's name. + The `kind` attribute is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private. + If the value is structured (has children), a handle is provided to retrieve the children with the `variables` request. + If the number of named or indexed children is large, the numbers should be returned via the `namedVariables` and `indexedVariables` attributes. + The client can use this information to present the children in a paged UI and fetch them in chunks. *) type t = { name : string; (** The variable's name. *) - value : string; (** The variable's value. This can be a multi-line text, e.g. for a function the body of a function. *) + value : string; (** The variable's value. + This can be a multi-line text, e.g. for a function the body of a function. + For structured variables (which do not have a simple value), it is recommended to provide a one-line representation of the structured object. This helps to identify the structured object in the collapsed state when its children are not yet visible. + An empty string can be used if no value should be shown in the UI. *) type_ : string option [@key "type"] [@default None]; (** The type of the variable's value. Typically shown in the UI when hovering over the value. - This attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request. *) + This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true. *) presentation_hint : Variable_presentation_hint.t option [@key "presentationHint"] [@default None]; (** Properties of a variable that can be used to determine how to render the variable in the UI. *) - evaluate_name : string option [@key "evaluateName"] [@default None]; (** Optional evaluatable name of this variable which can be passed to the 'EvaluateRequest' to fetch the variable's value. *) - variables_reference : int [@key "variablesReference"]; (** If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. *) + evaluate_name : string option [@key "evaluateName"] [@default None]; (** The evaluatable name of this variable which can be passed to the `evaluate` request to fetch the variable's value. *) + variables_reference : int [@key "variablesReference"]; (** If `variablesReference` is > 0, the variable is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) named_variables : int option [@key "namedVariables"] [@default None]; (** The number of named child variables. - The client can use this optional information to present the children in a paged UI and fetch them in chunks. *) + The client can use this information to present the children in a paged UI and fetch them in chunks. *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** The number of indexed child variables. - The client can use this optional information to present the children in a paged UI and fetch them in chunks. *) - memory_reference : string option [@key "memoryReference"] [@default None]; (** Optional memory reference for the variable if the variable represents executable code, such as a function pointer. - This attribute is only required if the client has passed the value true for the 'supportsMemoryReferences' capability of the 'initialize' request. *) + The client can use this information to present the children in a paged UI and fetch them in chunks. *) + memory_reference : string option [@key "memoryReference"] [@default None]; (** A memory reference associated with this variable. + For pointer type variables, this is generally a reference to the memory address contained in the pointer. + For executable data, this reference may later be used in a `disassemble` request. + This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true. *) + declaration_location_reference : int option [@key "declarationLocationReference"] [@default None]; (** A reference that allows the client to request the location where the variable is declared. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) + value_location_reference : int option [@key "valueLocationReference"] [@default None]; (** A reference that allows the client to request the location where the variable's value is declared. For example, if the variable contains a function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) __vscode_variable_menu_context : string option [@key "__vscodeVariableMenuContext"] [@default None]; } [@@deriving make, yojson {strict = false}] end module Breakpoint_location = struct - (** Properties of a breakpoint location returned from the 'breakpointLocations' request. *) + (** Properties of a breakpoint location returned from the `breakpointLocations` request. *) type t = { line : int; (** Start line of breakpoint location. *) - column : int option [@default None]; (** Optional start column of breakpoint location. *) - end_line : int option [@key "endLine"] [@default None]; (** Optional end line of breakpoint location if the location covers a range. *) - end_column : int option [@key "endColumn"] [@default None]; (** Optional end column of breakpoint location if the location covers a range. *) + column : int option [@default None]; (** The start position of a breakpoint location. Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of breakpoint location if the location covers a range. *) + end_column : int option [@key "endColumn"] [@default None]; (** The end position of a breakpoint location (if the location covers a range). Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) } [@@deriving make, yojson {strict = false}] end module Source_breakpoint = struct - (** Properties of a breakpoint or logpoint passed to the setBreakpoints request. *) + (** Properties of a breakpoint or logpoint passed to the `setBreakpoints` request. *) type t = { line : int; (** The source line of the breakpoint or logpoint. *) - column : int option [@default None]; (** An optional source column of the breakpoint. *) - condition : string option [@default None]; (** An optional expression for conditional breakpoints. - It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true. *) - hit_condition : string option [@key "hitCondition"] [@default None]; (** An optional expression that controls how many hits of the breakpoint are ignored. - The backend is expected to interpret the expression as needed. - The attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true. *) - log_message : string option [@key "logMessage"] [@default None]; (** If this attribute exists and is non-empty, the backend must not 'break' (stop) - but log the message instead. Expressions within \{\} are interpolated. - The attribute is only honored by a debug adapter if the capability 'supportsLogPoints' is true. *) + column : int option [@default None]; (** Start position within source line of the breakpoint or logpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + condition : string option [@default None]; (** The expression for conditional breakpoints. + It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true. *) + hit_condition : string option [@key "hitCondition"] [@default None]; (** The expression that controls how many hits of the breakpoint are ignored. + The debug adapter is expected to interpret the expression as needed. + The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true. + If both this property and `condition` are specified, `hitCondition` should be evaluated only if the `condition` is met, and the debug adapter should stop only if both conditions are met. *) + log_message : string option [@key "logMessage"] [@default None]; (** If this attribute exists and is non-empty, the debug adapter must not 'break' (stop) + but log the message instead. Expressions within `\{\}` are interpolated. + The attribute is only honored by a debug adapter if the corresponding capability `supportsLogPoints` is true. + If either `hitCondition` or `condition` is specified, then the message should only be logged if those conditions are met. *) + mode : string option [@default None]; (** The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. *) } [@@deriving make, yojson {strict = false}] end module Function_breakpoint = struct - (** Properties of a breakpoint passed to the setFunctionBreakpoints request. *) + (** Properties of a breakpoint passed to the `setFunctionBreakpoints` request. *) type t = { name : string; (** The name of the function. *) - condition : string option [@default None]; (** An optional expression for conditional breakpoints. - It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true. *) - hit_condition : string option [@key "hitCondition"] [@default None]; (** An optional expression that controls how many hits of the breakpoint are ignored. - The backend is expected to interpret the expression as needed. - The attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true. *) + condition : string option [@default None]; (** An expression for conditional breakpoints. + It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true. *) + hit_condition : string option [@key "hitCondition"] [@default None]; (** An expression that controls how many hits of the breakpoint are ignored. + The debug adapter is expected to interpret the expression as needed. + The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true. *) } [@@deriving make, yojson {strict = false}] end @@ -667,55 +726,80 @@ module Data_breakpoint_access_type = struct end module Data_breakpoint = struct - (** Properties of a data breakpoint passed to the setDataBreakpoints request. *) + (** Properties of a data breakpoint passed to the `setDataBreakpoints` request. *) type t = { - data_id : string [@key "dataId"]; (** An id representing the data. This id is returned from the dataBreakpointInfo request. *) + data_id : string [@key "dataId"]; (** An id representing the data. This id is returned from the `dataBreakpointInfo` request. *) access_type : Data_breakpoint_access_type.t option [@key "accessType"] [@default None]; (** The access type of the data. *) - condition : string option [@default None]; (** An optional expression for conditional breakpoints. *) - hit_condition : string option [@key "hitCondition"] [@default None]; (** An optional expression that controls how many hits of the breakpoint are ignored. - The backend is expected to interpret the expression as needed. *) + condition : string option [@default None]; (** An expression for conditional breakpoints. *) + hit_condition : string option [@key "hitCondition"] [@default None]; (** An expression that controls how many hits of the breakpoint are ignored. + The debug adapter is expected to interpret the expression as needed. *) } [@@deriving make, yojson {strict = false}] end module Instruction_breakpoint = struct - (** Properties of a breakpoint passed to the setInstructionBreakpoints request *) + (** Properties of a breakpoint passed to the `setInstructionBreakpoints` request *) type t = { instruction_reference : string [@key "instructionReference"]; (** The instruction reference of the breakpoint. - This should be a memory or instruction pointer reference from an EvaluateResponse, Variable, StackFrame, GotoTarget, or Breakpoint. *) - offset : int option [@default None]; (** An optional offset from the instruction reference. + This should be a memory or instruction pointer reference from an `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or `Breakpoint`. *) + offset : int option [@default None]; (** The offset from the instruction reference in bytes. This can be negative. *) - condition : string option [@default None]; (** An optional expression for conditional breakpoints. - It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true. *) - hit_condition : string option [@key "hitCondition"] [@default None]; (** An optional expression that controls how many hits of the breakpoint are ignored. - The backend is expected to interpret the expression as needed. - The attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true. *) + condition : string option [@default None]; (** An expression for conditional breakpoints. + It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true. *) + hit_condition : string option [@key "hitCondition"] [@default None]; (** An expression that controls how many hits of the breakpoint are ignored. + The debug adapter is expected to interpret the expression as needed. + The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true. *) + mode : string option [@default None]; (** The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. *) } [@@deriving make, yojson {strict = false}] end module Breakpoint = struct - (** Information about a Breakpoint created in setBreakpoints, setFunctionBreakpoints, setInstructionBreakpoints, or setDataBreakpoints. *) + module Reason = struct + (** A machine-readable explanation of why a breakpoint may not be verified. If a breakpoint is verified or a specific reason is not known, the adapter should omit this property. Possible values include: + + - `pending`: Indicates a breakpoint might be verified in the future, but the adapter cannot verify it in the current state. + - `failed`: Indicates a breakpoint was not able to be verified, and the adapter does not believe it can be verified without intervention. *) + type t = + | Pending [@name "pending"] + | Failed [@name "failed"] + + let of_yojson = function + | `String "pending" -> Ok Pending + | `String "failed" -> Ok Failed + | _ -> Error (print_exn_at_loc [%here]) + + let to_yojson = function + | Pending -> `String "pending" + | Failed -> `String "failed" + + end + + (** Information about a breakpoint created in `setBreakpoints`, `setFunctionBreakpoints`, `setInstructionBreakpoints`, or `setDataBreakpoints` requests. *) type t = { - id : int option [@default None]; (** An optional identifier for the breakpoint. It is needed if breakpoint events are used to update or remove breakpoints. *) - verified : bool; (** If true breakpoint could be set (but not necessarily at the desired location). *) - message : string option [@default None]; (** An optional message about the state of the breakpoint. + id : int option [@default None]; (** The identifier for the breakpoint. It is needed if breakpoint events are used to update or remove breakpoints. *) + verified : bool; (** If true, the breakpoint could be set (but not necessarily at the desired location). *) + message : string option [@default None]; (** A message about the state of the breakpoint. This is shown to the user and can be used to explain why a breakpoint could not be verified. *) source : Source.t option [@default None]; (** The source where the breakpoint is located. *) line : int option [@default None]; (** The start line of the actual range covered by the breakpoint. *) - column : int option [@default None]; (** An optional start column of the actual range covered by the breakpoint. *) - end_line : int option [@key "endLine"] [@default None]; (** An optional end line of the actual range covered by the breakpoint. *) - end_column : int option [@key "endColumn"] [@default None]; (** An optional end column of the actual range covered by the breakpoint. + column : int option [@default None]; (** Start position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the actual range covered by the breakpoint. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no end line is given, then the end column is assumed to be in the start line. *) - instruction_reference : string option [@key "instructionReference"] [@default None]; (** An optional memory reference to where the breakpoint is set. *) - offset : int option [@default None]; (** An optional offset from the instruction reference. + instruction_reference : string option [@key "instructionReference"] [@default None]; (** A memory reference to where the breakpoint is set. *) + offset : int option [@default None]; (** The offset from the instruction reference. This can be negative. *) + reason : Reason.t option [@default None]; (** A machine-readable explanation of why a breakpoint may not be verified. If a breakpoint is verified or a specific reason is not known, the adapter should omit this property. Possible values include: + + - `pending`: Indicates a breakpoint might be verified in the future, but the adapter cannot verify it in the current state. + - `failed`: Indicates a breakpoint was not able to be verified, and the adapter does not believe it can be verified without intervention. *) } [@@deriving make, yojson {strict = false}] end module Stepping_granularity = struct - (** The granularity of one 'step' in the stepping requests 'next', 'stepIn', 'stepOut', and 'stepBack'. *) + (** The granularity of one 'step' in the stepping requests `next`, `stepIn`, `stepOut`, and `stepBack`. *) type t = | Statement [@name "statement"] | Line [@name "line"] @@ -735,25 +819,29 @@ module Stepping_granularity = struct end module Step_in_target = struct - (** A StepInTarget can be used in the 'stepIn' request and determines into which single target the stepIn request should step. *) + (** A `StepInTarget` can be used in the `stepIn` request and determines into which single target the `stepIn` request should step. *) type t = { - id : int; (** Unique identifier for a stepIn target. *) - label : string; (** The name of the stepIn target (shown in the UI). *) + id : int; (** Unique identifier for a step-in target. *) + label : string; (** The name of the step-in target (shown in the UI). *) + line : int option [@default None]; (** The line of the step-in target. *) + column : int option [@default None]; (** Start position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the range covered by the step-in target. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) } [@@deriving make, yojson {strict = false}] end module Goto_target = struct - (** A GotoTarget describes a code location that can be used as a target in the 'goto' request. - The possible goto targets can be determined via the 'gotoTargets' request. *) + (** A `GotoTarget` describes a code location that can be used as a target in the `goto` request. + The possible goto targets can be determined via the `gotoTargets` request. *) type t = { - id : int; (** Unique identifier for a goto target. This is used in the goto request. *) + id : int; (** Unique identifier for a goto target. This is used in the `goto` request. *) label : string; (** The name of the goto target (shown in the UI). *) line : int; (** The line of the goto target. *) - column : int option [@default None]; (** An optional column of the goto target. *) - end_line : int option [@key "endLine"] [@default None]; (** An optional end line of the range covered by the goto target. *) - end_column : int option [@key "endColumn"] [@default None]; (** An optional end column of the range covered by the goto target. *) - instruction_pointer_reference : string option [@key "instructionPointerReference"] [@default None]; (** Optional memory reference for the instruction pointer value represented by this target. *) + column : int option [@default None]; (** The column of the goto target. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the range covered by the goto target. *) + end_column : int option [@key "endColumn"] [@default None]; (** The end column of the range covered by the goto target. *) + instruction_pointer_reference : string option [@key "instructionPointerReference"] [@default None]; (** A memory reference for the instruction pointer value represented by this target. *) } [@@deriving make, yojson {strict = false}] end @@ -827,22 +915,17 @@ module Completion_item_type = struct end module Completion_item = struct - (** CompletionItems are the suggestions returned from the CompletionsRequest. *) + (** `CompletionItems` are the suggestions returned from the `completions` request. *) type t = { label : string; (** The label of this completion item. By default this is also the text that is inserted when selecting this completion. *) - text : string option [@default None]; (** If text is not falsy then it is inserted instead of the label. *) - sort_text : string option [@key "sortText"] [@default None]; (** A string that should be used when comparing this item with other items. When `falsy` the label is used. *) + text : string option [@default None]; (** If text is returned and not an empty string, then it is inserted instead of the label. *) + sort_text : string option [@key "sortText"] [@default None]; (** A string that should be used when comparing this item with other items. If not returned or an empty string, the `label` is used instead. *) + detail : string option [@default None]; (** A human-readable string with additional information about this item, like type or symbol information. *) type_ : Completion_item_type.t option [@key "type"] [@default None]; (** The item's type. Typically the client uses this information to render the item in the UI with an icon. *) - start : int option [@default None]; (** This value determines the location (in the CompletionsRequest's 'text' attribute) where the completion text is added. - If missing the text is added at the location specified by the CompletionsRequest's 'column' attribute. *) - length : int option [@default None]; (** This value determines how many characters are overwritten by the completion text. - If missing the value 0 is assumed which results in the completion text being inserted. *) - selection_start : int option [@key "selectionStart"] [@default None]; (** Determines the start of the new selection after the text has been inserted (or replaced). - The start position must in the range 0 and length of the completion text. - If omitted the selection starts at the end of the completion text. *) - selection_length : int option [@key "selectionLength"] [@default None]; (** Determines the length of the new selection after the text has been inserted (or replaced). - The selection can not extend beyond the bounds of the completion text. - If omitted the length is assumed to be 0. *) + start : int option [@default None]; (** Start position (within the `text` attribute of the `completions` request) where the completion text is added. The position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If the start position is omitted the text is added at the location specified by the `column` attribute of the `completions` request. *) + length : int option [@default None]; (** Length determines how many characters are overwritten by the completion text and it is measured in UTF-16 code units. If missing the value 0 is assumed which results in the completion text being inserted. *) + selection_start : int option [@key "selectionStart"] [@default None]; (** Determines the start of the new selection after the text has been inserted (or replaced). `selectionStart` is measured in UTF-16 code units and must be in the range 0 and length of the completion text. If omitted the selection starts at the end of the completion text. *) + selection_length : int option [@key "selectionLength"] [@default None]; (** Determines the length of the new selection after the text has been inserted (or replaced) and it is measured in UTF-16 code units. The selection can not extend beyond the bounds of the completion text. If omitted the length is assumed to be 0. *) } [@@deriving make, yojson {strict = false}] end @@ -870,22 +953,22 @@ module Stack_frame_format = struct end module Exception_filter_options = struct - (** An ExceptionFilterOptions is used to specify an exception filter together with a condition for the setExceptionsFilter request. *) + (** An `ExceptionFilterOptions` is used to specify an exception filter together with a condition for the `setExceptionBreakpoints` request. *) type t = { - filter_id : string [@key "filterId"]; (** ID of an exception filter returned by the 'exceptionBreakpointFilters' capability. *) - condition : string option [@default None]; (** An optional expression for conditional exceptions. - The exception will break into the debugger if the result of the condition is true. *) + filter_id : string [@key "filterId"]; (** ID of an exception filter returned by the `exceptionBreakpointFilters` capability. *) + condition : string option [@default None]; (** An expression for conditional exceptions. + The exception breaks into the debugger if the result of the condition is true. *) + mode : string option [@default None]; (** The mode of this exception breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. *) } [@@deriving make, yojson {strict = false}] end module Exception_path_segment = struct - (** An ExceptionPathSegment represents a segment in a path that is used to match leafs or nodes in a tree of exceptions. - If a segment consists of more than one name, it matches the names provided if 'negate' is false or missing or - it matches anything except the names provided if 'negate' is true. *) + (** An `ExceptionPathSegment` represents a segment in a path that is used to match leafs or nodes in a tree of exceptions. + If a segment consists of more than one name, it matches the names provided if `negate` is false or missing, or it matches anything except the names provided if `negate` is true. *) type t = { negate : bool option [@default None]; (** If false or missing this segment matches the names provided, otherwise it matches anything except the names provided. *) - names : string list; (** Depending on the value of 'negate' the names that should match or not match. *) + names : string list; (** Depending on the value of `negate` the names that should match or not match. *) } [@@deriving make, yojson {strict = false}] end @@ -918,9 +1001,9 @@ module Exception_break_mode = struct end module Exception_options = struct - (** An ExceptionOptions assigns configuration options to a set of exceptions. *) + (** An `ExceptionOptions` assigns configuration options to a set of exceptions. *) type t = { - path : Exception_path_segment.t list option [@default None]; (** A path that selects a single or multiple exceptions in a tree. If 'path' is missing, the whole tree is selected. + path : Exception_path_segment.t list option [@default None]; (** A path that selects a single or multiple exceptions in a tree. If `path` is missing, the whole tree is selected. By convention the first segment of the path is a category that is used to group exceptions in the UI. *) break_mode : Exception_break_mode.t [@key "breakMode"]; (** Condition when a thrown exception should result in a break. *) } @@ -933,7 +1016,7 @@ module Exception_details = struct message : string option [@default None]; (** Message contained in the exception. *) type_name : string option [@key "typeName"] [@default None]; (** Short type name of the exception object. *) full_type_name : string option [@key "fullTypeName"] [@default None]; (** Fully-qualified type name of the exception object. *) - evaluate_name : string option [@key "evaluateName"] [@default None]; (** Optional expression that can be evaluated in the current scope to obtain the exception object. *) + evaluate_name : string option [@key "evaluateName"] [@default None]; (** An expression that can be evaluated in the current scope to obtain the exception object. *) stack_trace : string option [@key "stackTrace"] [@default None]; (** Stack trace at the time the exception was thrown. *) inner_exception : t list option [@key "innerException"] [@default None]; (** Details of the exception contained by this exception, if any. *) } @@ -941,10 +1024,29 @@ module Exception_details = struct end module Disassembled_instruction = struct + module Presentation_hint = struct + (** A hint for how to present the instruction in the UI. + + A value of `invalid` may be used to indicate this instruction is 'filler' and cannot be reached by the program. For example, unreadable memory addresses may be presented is 'invalid.' *) + type t = + | Normal [@name "normal"] + | Invalid [@name "invalid"] + + let of_yojson = function + | `String "normal" -> Ok Normal + | `String "invalid" -> Ok Invalid + | _ -> Error (print_exn_at_loc [%here]) + + let to_yojson = function + | Normal -> `String "normal" + | Invalid -> `String "invalid" + + end + (** Represents a single disassembled instruction. *) type t = { - address : string; (** The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. *) - instruction_bytes : string option [@key "instructionBytes"] [@default None]; (** Optional raw bytes representing the instruction and its operands, in an implementation-defined format. *) + address : string; (** The address of the instruction. Treated as a hex value if prefixed with `0x`, or as a decimal value otherwise. *) + instruction_bytes : string option [@key "instructionBytes"] [@default None]; (** Raw bytes representing the instruction and its operands, in an implementation-defined format. *) instruction : string; (** Text representing the instruction and its operands, in an implementation-defined format. *) symbol : string option [@default None]; (** Name of the symbol that corresponds with the location of this instruction, if any. *) location : Source.t option [@default None]; (** Source location that corresponds to this instruction, if any. @@ -954,12 +1056,15 @@ module Disassembled_instruction = struct column : int option [@default None]; (** The column within the line that corresponds to this instruction, if any. *) end_line : int option [@key "endLine"] [@default None]; (** The end line of the range that corresponds to this instruction, if any. *) end_column : int option [@key "endColumn"] [@default None]; (** The end column of the range that corresponds to this instruction, if any. *) + presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** A hint for how to present the instruction in the UI. + + A value of `invalid` may be used to indicate this instruction is 'filler' and cannot be reached by the program. For example, unreadable memory addresses may be presented is 'invalid.' *) } [@@deriving make, yojson {strict = false}] end module Invalidated_areas = struct - (** Logical areas that can be invalidated by the 'invalidated' event. *) + (** Logical areas that can be invalidated by the `invalidated` event. *) type t = | All [@name "all"] | Stacks [@name "stacks"] @@ -997,7 +1102,7 @@ module Stopped_event = struct module Payload = struct module Reason = struct (** The reason for the event. - For backward compatibility this string is shown in the UI if the 'description' attribute is missing (but it must not be translated). *) + For backward compatibility this string is shown in the UI if the `description` attribute is missing (but it must not be translated). *) type t = | Step [@name "step"] | Breakpoint [@name "breakpoint"] @@ -1037,14 +1142,18 @@ module Stopped_event = struct type t = { reason : Reason.t; (** The reason for the event. - For backward compatibility this string is shown in the UI if the 'description' attribute is missing (but it must not be translated). *) - description : string option [@default None]; (** The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is and must be translated. *) + For backward compatibility this string is shown in the UI if the `description` attribute is missing (but it must not be translated). *) + description : string option [@default None]; (** The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is and can be translated. *) thread_id : int option [@key "threadId"] [@default None]; (** The thread which was stopped. *) - preserve_focus_hint : bool option [@key "preserveFocusHint"] [@default None]; (** A value of true hints to the frontend that this event should not change the focus. *) - text : string option [@default None]; (** Additional information. E.g. if reason is 'exception', text contains the exception name. This string is shown in the UI. *) - all_threads_stopped : bool option [@key "allThreadsStopped"] [@default None]; (** If 'allThreadsStopped' is true, a debug adapter can announce that all threads have stopped. + preserve_focus_hint : bool option [@key "preserveFocusHint"] [@default None]; (** A value of true hints to the client that this event should not change the focus. *) + text : string option [@default None]; (** Additional information. E.g. if reason is `exception`, text contains the exception name. This string is shown in the UI. *) + all_threads_stopped : bool option [@key "allThreadsStopped"] [@default None]; (** If `allThreadsStopped` is true, a debug adapter can announce that all threads have stopped. - The client should use this information to enable that all threads can be expanded to access their stacktraces. - - If the attribute is missing or false, only the thread with the given threadId can be expanded. *) + - If the attribute is missing or false, only the thread with the given `threadId` can be expanded. *) + hit_breakpoint_ids : int list option [@key "hitBreakpointIds"] [@default None]; (** Ids of the breakpoints that triggered the event. In most cases there is only a single breakpoint but here are some examples for multiple breakpoints: + - Different types of breakpoints map to the same location. + - Multiple source breakpoints get collapsed to the same instruction by the compiler/runtime. + - Multiple function breakpoints with different function names map to the same location. *) } [@@deriving make, yojson {strict = false}] end @@ -1056,7 +1165,7 @@ module Continued_event = struct module Payload = struct type t = { thread_id : int [@key "threadId"]; (** The thread which was continued. *) - all_threads_continued : bool option [@key "allThreadsContinued"] [@default None]; (** If 'allThreadsContinued' is true, a debug adapter can announce that all threads have continued. *) + all_threads_continued : bool option [@key "allThreadsContinued"] [@default None]; (** If `allThreadsContinued` is true, a debug adapter can announce that all threads have continued. *) } [@@deriving make, yojson {strict = false}] end @@ -1078,8 +1187,8 @@ module Terminated_event = struct module Payload = struct type t = { - restart : Any.t option [@default None]; (** A debug adapter may set 'restart' to true (or to an arbitrary object) to request that the front end restarts the session. - The value is not interpreted by the client and passed unmodified as an attribute '__restart' to the 'launch' and 'attach' requests. *) + restart : Any.t option [@default None]; (** A debug adapter may set `restart` to true (or to an arbitrary object) to request that the client restarts the session. + The value is not interpreted by the client and passed unmodified as an attribute `__restart` to the `launch` and `attach` requests. *) } [@@deriving make, yojson {strict = false}] end @@ -1120,9 +1229,10 @@ module Output_event = struct module Payload = struct module Category = struct - (** The output category. If not specified, 'console' is assumed. *) + (** The output category. If not specified or if the category is not understood by the client, `console` is assumed. *) type t = | Console [@name "console"] + | Important [@name "important"] | Stdout [@name "stdout"] | Stderr [@name "stderr"] | Telemetry [@name "telemetry"] @@ -1130,6 +1240,7 @@ module Output_event = struct let of_yojson = function | `String "console" -> Ok Console + | `String "important" -> Ok Important | `String "stdout" -> Ok Stdout | `String "stderr" -> Ok Stderr | `String "telemetry" -> Ok Telemetry @@ -1137,6 +1248,7 @@ module Output_event = struct let to_yojson = function | Console -> `String "console" + | Important -> `String "important" | Stdout -> `String "stdout" | Stderr -> `String "stderr" | Telemetry -> `String "telemetry" @@ -1164,14 +1276,21 @@ module Output_event = struct end type t = { - category : Category.t option [@default None]; (** The output category. If not specified, 'console' is assumed. *) - output : string; (** The output to report. *) + category : Category.t option [@default None]; (** The output category. If not specified or if the category is not understood by the client, `console` is assumed. *) + output : string; (** The output to report. + + ANSI escape sequences may be used to influence text color and styling if `supportsANSIStyling` is present in both the adapter's `Capabilities` and the client's `InitializeRequestArguments`. A client may strip any unrecognized ANSI sequences. + + If the `supportsANSIStyling` capabilities are not both true, then the client should display the output literally. *) group : Group.t option [@default None]; (** Support for keeping an output log organized by grouping related messages. *) - variables_reference : int option [@key "variablesReference"] [@default None]; (** 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 : Source.t option [@default None]; (** An optional source location where the output was produced. *) - line : int option [@default None]; (** An optional source location line where the output was produced. *) - column : int option [@default None]; (** An optional source location column where the output was produced. *) - data : Any.t option [@default None]; (** Optional data to report. For the 'telemetry' category the data will be sent to telemetry, for the other categories the data is shown in JSON format. *) + variables_reference : int option [@key "variablesReference"] [@default None]; (** 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 as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) + source : Source.t option [@default None]; (** The source location where the output was produced. *) + line : int option [@default None]; (** The source location's line where the output was produced. *) + column : int option [@default None]; (** The position in `line` where the output was produced. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + data : Any.t option [@default None]; (** Additional data to report. For the `telemetry` category the data is sent to telemetry, for the other categories the data is shown in JSON format. *) + location_reference : int option [@key "locationReference"] [@default None]; (** A reference that allows the client to request the location where the new value is declared. For example, if the logged value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end @@ -1204,7 +1323,7 @@ module Breakpoint_event = struct type t = { reason : Reason.t; (** The reason for the event. *) - breakpoint : Breakpoint.t; (** The 'id' attribute is used to find the target breakpoint and the other attributes are used as the new values. *) + breakpoint : Breakpoint.t; (** The `id` attribute is used to find the target breakpoint, the other attributes are used as the new values. *) } [@@deriving make, yojson {strict = false}] end @@ -1236,7 +1355,7 @@ module Module_event = struct type t = { reason : Reason.t; (** The reason for the event. *) - module_ : Module.t [@key "module"]; (** The new, changed, or removed module. In case of 'removed' only the module id is used. *) + module_ : Module.t [@key "module"]; (** The new, changed, or removed module. In case of `removed` only the module id is used. *) } [@@deriving make, yojson {strict = false}] end @@ -1300,7 +1419,7 @@ module Process_event = struct type t = { name : string; (** The logical name of the process. This is usually the full path to process's executable file. Example: /home/example/myproj/program.js. *) - system_process_id : int option [@key "systemProcessId"] [@default None]; (** The system process id of the debugged process. This property will be missing for non-system processes. *) + system_process_id : int option [@key "systemProcessId"] [@default None]; (** The process ID of the debugged process, as assigned by the operating system. This property should be omitted for logical processes that do not map to operating system processes on the machine. *) is_local_process : bool option [@key "isLocalProcess"] [@default None]; (** If true, the process is running on the same computer as the debug adapter. *) start_method : Start_method.t option [@key "startMethod"] [@default None]; (** Describes how the debug engine started debugging this process. *) pointer_size : int option [@key "pointerSize"] [@default None]; (** The size of a pointer or address for this process, in bits. This value may be used by clients when formatting addresses for display. *) @@ -1325,17 +1444,16 @@ module Progress_start_event = struct module Payload = struct type t = { - progress_id : string [@key "progressId"]; (** An ID that must be used in subsequent 'progressUpdate' and 'progressEnd' events to make them refer to the same progress reporting. + progress_id : string [@key "progressId"]; (** An ID that can be used in subsequent `progressUpdate` and `progressEnd` events to make them refer to the same progress reporting. IDs must be unique within a debug session. *) - title : string; (** Mandatory (short) title of the progress reporting. Shown in the UI to describe the long running operation. *) - request_id : int option [@key "requestId"] [@default None]; (** The request ID that this progress report is related to. If specified a debug adapter is expected to emit - progress events for the long running request until the request has been either completed or cancelled. + title : string; (** Short title of the progress reporting. Shown in the UI to describe the long running operation. *) + request_id : int option [@key "requestId"] [@default None]; (** The request ID that this progress report is related to. If specified a debug adapter is expected to emit progress events for the long running request until the request has been either completed or cancelled. If the request ID is omitted, the progress report is assumed to be related to some general activity of the debug adapter. *) - cancellable : bool option [@default None]; (** If true, the request that reports progress may be canceled with a 'cancel' request. + cancellable : bool option [@default None]; (** If true, the request that reports progress may be cancelled with a `cancel` request. So this property basically controls whether the client should use UX that supports cancellation. Clients that don't support cancellation are allowed to ignore the setting. *) - message : string option [@default None]; (** Optional, more detailed progress message. *) - percentage : float option [@default None]; (** Optional progress percentage to display (value range: 0 to 100). If omitted no percentage will be shown. *) + message : string option [@default None]; (** More detailed progress message. *) + percentage : float option [@default None]; (** Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown. *) } [@@deriving make, yojson {strict = false}] end @@ -1346,9 +1464,9 @@ module Progress_update_event = struct module Payload = struct type t = { - progress_id : string [@key "progressId"]; (** The ID that was introduced in the initial 'progressStart' event. *) - message : string option [@default None]; (** Optional, more detailed progress message. If omitted, the previous message (if any) is used. *) - percentage : float option [@default None]; (** Optional progress percentage to display (value range: 0 to 100). If omitted no percentage will be shown. *) + progress_id : string [@key "progressId"]; (** The ID that was introduced in the initial `progressStart` event. *) + message : string option [@default None]; (** More detailed progress message. If omitted, the previous message (if any) is used. *) + percentage : float option [@default None]; (** Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown. *) } [@@deriving make, yojson {strict = false}] end @@ -1359,8 +1477,8 @@ module Progress_end_event = struct module Payload = struct type t = { - progress_id : string [@key "progressId"]; (** The ID that was introduced in the initial 'ProgressStartEvent'. *) - message : string option [@default None]; (** Optional, more detailed progress message. If omitted, the previous message (if any) is used. *) + progress_id : string [@key "progressId"]; (** The ID that was introduced in the initial `ProgressStartEvent`. *) + message : string option [@default None]; (** More detailed progress message. If omitted, the previous message (if any) is used. *) } [@@deriving make, yojson {strict = false}] end @@ -1371,35 +1489,47 @@ module Invalidated_event = struct module Payload = struct type t = { - areas : Invalidated_areas.t list option [@default None]; (** Optional set of logical areas that got invalidated. This property has a hint characteristic: a client can only be expected to make a 'best effort' in honouring the areas but there are no guarantees. If this property is missing, empty, or if values are not understand the client should assume a single value 'all'. *) + areas : Invalidated_areas.t list option [@default None]; (** Set of logical areas that got invalidated. This property has a hint characteristic: a client can only be expected to make a 'best effort' in honoring the areas but there are no guarantees. If this property is missing, empty, or if values are not understood, the client should assume a single value `all`. *) thread_id : int option [@key "threadId"] [@default None]; (** If specified, the client only needs to refetch data related to this thread. *) - stack_frame_id : int option [@key "stackFrameId"] [@default None]; (** If specified, the client only needs to refetch data related to this stack frame (and the 'threadId' is ignored). *) + stack_frame_id : int option [@key "stackFrameId"] [@default None]; (** If specified, the client only needs to refetch data related to this stack frame (and the `threadId` is ignored). *) } [@@deriving make, yojson {strict = false}] end end -(** The 'cancel' request is used by the frontend in two situations: +module Memory_event = struct + let type_ = "memory" + + module Payload = struct + type t = { + memory_reference : string [@key "memoryReference"]; (** Memory reference of a memory range that has been updated. *) + offset : int; (** Starting offset in bytes where memory has been updated. Can be negative. *) + count : int; (** Number of bytes updated. *) + } + [@@deriving make, yojson {strict = false}] + end +end + +(** The `cancel` request is used by the client in two situations: - to indicate that it is no longer interested in the result produced by a specific request issued earlier -- to cancel a progress sequence. Clients should only call this request if the capability 'supportsCancelRequest' is true. -This request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honouring this request but there are no guarantees. -The 'cancel' request may return an error if it could not cancel an operation but a frontend should refrain from presenting this error to end users. -A frontend client should only call this request if the capability 'supportsCancelRequest' is true. -The request that got canceled still needs to send a response back. This can either be a normal result ('success' attribute true) -or an error response ('success' attribute false and the 'message' set to 'cancelled'). -Returning partial results from a cancelled request is possible but please note that a frontend client has no generic way for detecting that a response is partial or not. - The progress that got cancelled still needs to send a 'progressEnd' event back. - A client should not assume that progress just got cancelled after sending the 'cancel' request. *) +- to cancel a progress sequence. +Clients should only call this request if the corresponding capability `supportsCancelRequest` is true. +This request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees. +The `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users. +The request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`). +Returning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not. +The progress that got cancelled still needs to send a `progressEnd` event back. + A client should not assume that progress just got cancelled after sending the `cancel` request. *) module Cancel_command = struct let type_ = "cancel" module Arguments = struct - (** Arguments for 'cancel' request. *) + (** Arguments for `cancel` request. *) type t = { - request_id : int option [@key "requestId"] [@default None]; (** The ID (attribute 'seq') of the request to cancel. If missing no request is cancelled. - Both a 'requestId' and a 'progressId' can be specified in one request. *) - progress_id : string option [@key "progressId"] [@default None]; (** The ID (attribute 'progressId') of the progress to cancel. If missing no progress is cancelled. - Both a 'requestId' and a 'progressId' can be specified in one request. *) + request_id : int option [@key "requestId"] [@default None]; (** The ID (attribute `seq`) of the request to cancel. If missing no request is cancelled. + Both a `requestId` and a `progressId` can be specified in one request. *) + progress_id : string option [@key "progressId"] [@default None]; (** The ID (attribute `progressId`) of the progress to cancel. If missing no progress is cancelled. + Both a `requestId` and a `progressId` can be specified in one request. *) } [@@deriving make, yojson {strict = false}] end @@ -1410,15 +1540,17 @@ module Cancel_command = struct end end -(** This optional request is sent from the debug adapter to the client to run a command in a terminal. +(** This request is sent from the debug adapter to the client to run a command in a terminal. This is typically used to launch the debuggee in a terminal provided by the client. -This request should only be called if the client has passed the value true for the 'supportsRunInTerminalRequest' capability of the 'initialize' request. *) +This request should only be called if the corresponding client capability `supportsRunInTerminalRequest` is true. +Client implementations of `runInTerminal` are free to run the command however they choose including issuing the command to a command line interpreter (aka 'shell'). Argument strings passed to the `runInTerminal` request must arrive verbatim in the command to be run. As a consequence, clients which use a shell are responsible for escaping any special shell characters in the argument strings to prevent them from being interpreted (and modified) by the shell. +Some users may wish to take advantage of shell processing in the argument strings. For clients which implement `runInTerminal` using an intermediary shell, the `argsCanBeInterpretedByShell` property can be set to true. In this case the client is requested not to escape any special shell characters in the argument strings. *) module Run_in_terminal_command = struct let type_ = "runInTerminal" module Arguments = struct module Kind = struct - (** What kind of terminal to launch. *) + (** What kind of terminal to launch. Defaults to `integrated` if not specified. *) type t = | Integrated [@name "integrated"] | External [@name "external"] @@ -1440,13 +1572,14 @@ module Run_in_terminal_command = struct [@@deriving yojson] end - (** Arguments for 'runInTerminal' request. *) + (** Arguments for `runInTerminal` request. *) type t = { - kind : Kind.t option [@default None]; (** What kind of terminal to launch. *) - title : string option [@default None]; (** Optional title of the terminal. *) + kind : Kind.t option [@default None]; (** What kind of terminal to launch. Defaults to `integrated` if not specified. *) + title : string option [@default None]; (** Title of the terminal. *) cwd : string; (** Working directory for the command. For non-empty, valid paths this typically results in execution of a change directory command. *) args : string list; (** List of arguments. The first argument is the command to run. *) env : Env.t option [@default None]; (** Environment key-value pairs that are added to or removed from the default environment. *) + args_can_be_interpreted_by_shell : bool option [@key "argsCanBeInterpretedByShell"] [@default None]; (** This property should only be set if the corresponding capability `supportsArgsCanBeInterpretedByShell` is true. If the client uses an intermediary shell to launch the application, then the client must not attempt to escape characters with special meanings for the shell. The user is fully responsible for escaping as needed and that arguments using special characters may not be portable across shells. *) } [@@deriving make, yojson {strict = false}] end @@ -1460,17 +1593,60 @@ module Run_in_terminal_command = struct end end -(** The 'initialize' request is sent as the first request from the client to the debug adapter -in order to configure it with client capabilities and to retrieve capabilities from the debug adapter. -Until the debug adapter has responded to with an 'initialize' response, the client must not send any additional requests or events to the debug adapter. -In addition the debug adapter is not allowed to send any requests or events to the client until it has responded with an 'initialize' response. -The 'initialize' request may only be sent once. *) +(** This request is sent from the debug adapter to the client to start a new debug session of the same type as the caller. +This request should only be sent if the corresponding client capability `supportsStartDebuggingRequest` is true. +A client implementation of `startDebugging` should start a new debug session (of the same type as the caller) in the same way that the caller's session was started. If the client supports hierarchical debug sessions, the newly created session can be treated as a child of the caller session. *) +module Start_debugging_command = struct + let type_ = "startDebugging" + + module Arguments = struct + module Configuration = struct + (** Arguments passed to the new debug session. The arguments must only contain properties understood by the `launch` or `attach` requests of the debug adapter and they must not contain any client-specific properties (e.g. `type`) or client-specific features (e.g. substitutable 'variables'). *) + type t = Yojson.Safe.t + [@@deriving yojson] + end + + module Request = struct + (** Indicates whether the new debug session should be started with a `launch` or `attach` request. *) + type t = + | Launch [@name "launch"] + | Attach [@name "attach"] + + let of_yojson = function + | `String "launch" -> Ok Launch + | `String "attach" -> Ok Attach + | _ -> Error (print_exn_at_loc [%here]) + + let to_yojson = function + | Launch -> `String "launch" + | Attach -> `String "attach" + + end + + (** Arguments for `startDebugging` request. *) + type t = { + configuration : Configuration.t; (** Arguments passed to the new debug session. The arguments must only contain properties understood by the `launch` or `attach` requests of the debug adapter and they must not contain any client-specific properties (e.g. `type`) or client-specific features (e.g. substitutable 'variables'). *) + request : Request.t; (** Indicates whether the new debug session should be started with a `launch` or `attach` request. *) + } + [@@deriving make, yojson {strict = false}] + end + + module Result = struct + type t = Empty_dict.t + [@@deriving yojson] + end +end + +(** The `initialize` request is sent as the first request from the client to the debug adapter in order to configure it with client capabilities and to retrieve capabilities from the debug adapter. +Until the debug adapter has responded with an `initialize` response, the client must not send any additional requests or events to the debug adapter. +In addition the debug adapter is not allowed to send any requests or events to the client until it has responded with an `initialize` response. +The `initialize` request may only be sent once. *) module Initialize_command = struct let type_ = "initialize" module Arguments = struct module Path_format = struct - (** Determines in what format paths are specified. The default is 'path', which is the native format. *) + (** Determines in what format paths are specified. The default is `path`, which is the native format. *) type t = | Path [@name "path"] | Uri [@name "uri"] @@ -1487,21 +1663,25 @@ module Initialize_command = struct | Custom str -> `String str end - (** Arguments for 'initialize' request. *) + (** Arguments for `initialize` request. *) type t = { - client_id : string option [@key "clientID"] [@default None]; (** The ID of the (frontend) client using this adapter. *) - client_name : string option [@key "clientName"] [@default None]; (** The human readable name of the (frontend) client using this adapter. *) + client_id : string option [@key "clientID"] [@default None]; (** The ID of the client using this adapter. *) + client_name : string option [@key "clientName"] [@default None]; (** The human-readable name of the client using this adapter. *) adapter_id : string [@key "adapterID"]; (** The ID of the debug adapter. *) - locale : string option [@default None]; (** The ISO-639 locale of the (frontend) client using this adapter, e.g. en-US or de-CH. *) + locale : string option [@default None]; (** The ISO-639 locale of the client using this adapter, e.g. en-US or de-CH. *) lines_start_at1 : bool option [@key "linesStartAt1"] [@default None]; (** If true all line numbers are 1-based (default). *) columns_start_at1 : bool option [@key "columnsStartAt1"] [@default None]; (** If true all column numbers are 1-based (default). *) - path_format : Path_format.t option [@key "pathFormat"] [@default None]; (** Determines in what format paths are specified. The default is 'path', which is the native format. *) - supports_variable_type : bool option [@key "supportsVariableType"] [@default None]; (** Client supports the optional type attribute for variables. *) + path_format : Path_format.t option [@key "pathFormat"] [@default None]; (** Determines in what format paths are specified. The default is `path`, which is the native format. *) + supports_variable_type : bool option [@key "supportsVariableType"] [@default None]; (** Client supports the `type` attribute for variables. *) supports_variable_paging : bool option [@key "supportsVariablePaging"] [@default None]; (** Client supports the paging of variables. *) - supports_run_in_terminal_request : bool option [@key "supportsRunInTerminalRequest"] [@default None]; (** Client supports the runInTerminal request. *) + supports_run_in_terminal_request : bool option [@key "supportsRunInTerminalRequest"] [@default None]; (** Client supports the `runInTerminal` request. *) supports_memory_references : bool option [@key "supportsMemoryReferences"] [@default None]; (** Client supports memory references. *) supports_progress_reporting : bool option [@key "supportsProgressReporting"] [@default None]; (** Client supports progress reporting. *) - supports_invalidated_event : bool option [@key "supportsInvalidatedEvent"] [@default None]; (** Client supports the invalidated event. *) + supports_invalidated_event : bool option [@key "supportsInvalidatedEvent"] [@default None]; (** Client supports the `invalidated` event. *) + supports_memory_event : bool option [@key "supportsMemoryEvent"] [@default None]; (** Client supports the `memory` event. *) + supports_args_can_be_interpreted_by_shell : bool option [@key "supportsArgsCanBeInterpretedByShell"] [@default None]; (** Client supports the `argsCanBeInterpretedByShell` attribute on the `runInTerminal` request. *) + supports_start_debugging_request : bool option [@key "supportsStartDebuggingRequest"] [@default None]; (** Client supports the `startDebugging` request. *) + supports_ansistyling : bool option [@key "supportsANSIStyling"] [@default None]; (** The client will interpret ANSI escape sequences in the display of `OutputEvent.output` and `Variable.value` fields when `Capabilities.supportsANSIStyling` is also enabled. *) } [@@deriving make, yojson {strict = false}] end @@ -1513,14 +1693,14 @@ module Initialize_command = struct end end -(** This optional request indicates that the client has finished initialization of the debug adapter. -So it is the last request in the sequence of configuration requests (which was started by the 'initialized' event). -Clients should only call this request if the capability 'supportsConfigurationDoneRequest' is true. *) +(** This request indicates that the client has finished initialization of the debug adapter. +So it is the last request in the sequence of configuration requests (which was started by the `initialized` event). +Clients should only call this request if the corresponding capability `supportsConfigurationDoneRequest` is true. *) module Configuration_done_command = struct let type_ = "configurationDone" module Arguments = struct - (** Arguments for 'configurationDone' request. *) + (** Arguments for `configurationDone` request. *) type t = Empty_dict.t [@@deriving yojson] end @@ -1531,17 +1711,17 @@ module Configuration_done_command = struct end end -(** This launch request is sent from the client to the debug adapter to start the debuggee with or without debugging (if 'noDebug' is true). +(** This launch request is sent from the client to the debug adapter to start the debuggee with or without debugging (if `noDebug` is true). Since launching is debugger/runtime specific, the arguments for this request are not part of this specification. *) module Launch_command = struct let type_ = "launch" module Arguments = struct - (** Arguments for 'launch' request. Additional attributes are implementation specific. *) + (** Arguments for `launch` request. Additional attributes are implementation specific. *) type t = { - no_debug : bool option [@key "noDebug"] [@default None]; (** If noDebug is true the launch request should launch the program without enabling debugging. *) - __restart : Any.t option [@default None]; (** Optional data from the previous, restarted session. - The data is sent as the 'restart' attribute of the 'terminated' event. + no_debug : bool option [@key "noDebug"] [@default None]; (** If true, the launch request should launch the program without enabling debugging. *) + __restart : Any.t option [@default None]; (** Arbitrary data from the previous, restarted session. + The data is sent as the `restart` attribute of the `terminated` event. The client should leave the data intact. *) } [@@deriving make, yojson {strict = false}] @@ -1553,16 +1733,16 @@ module Launch_command = struct end end -(** The attach request is sent from the client to the debug adapter to attach to a debuggee that is already running. +(** The `attach` request is sent from the client to the debug adapter to attach to a debuggee that is already running. Since attaching is debugger/runtime specific, the arguments for this request are not part of this specification. *) module Attach_command = struct let type_ = "attach" module Arguments = struct - (** Arguments for 'attach' request. Additional attributes are implementation specific. *) + (** Arguments for `attach` request. Additional attributes are implementation specific. *) type t = { - __restart : Any.t option [@default None]; (** Optional data from the previous, restarted session. - The data is sent as the 'restart' attribute of the 'terminated' event. + __restart : Any.t option [@default None]; (** Arbitrary data from the previous, restarted session. + The data is sent as the `restart` attribute of the `terminated` event. The client should leave the data intact. *) } [@@deriving make, yojson {strict = false}] @@ -1574,13 +1754,12 @@ module Attach_command = struct end end -(** Restarts a debug session. Clients should only call this request if the capability 'supportsRestartRequest' is true. -If the capability is missing or has the value false, a typical client will emulate 'restart' by terminating the debug adapter first and then launching it anew. *) +(** Restarts a debug session. Clients should only call this request if the corresponding capability `supportsRestartRequest` is true. +If the capability is missing or has the value false, a typical client emulates `restart` by terminating the debug adapter first and then launching it anew. *) module Restart_command = struct let type_ = "restart" module Arguments = struct - (** Arguments for 'restart' request. *) type t = Empty_dict.t [@@deriving yojson] end @@ -1591,21 +1770,22 @@ module Restart_command = struct end end -(** The 'disconnect' request is sent from the client to the debug adapter in order to stop debugging. -It asks the debug adapter to disconnect from the debuggee and to terminate the debug adapter. -If the debuggee has been started with the 'launch' request, the 'disconnect' request terminates the debuggee. -If the 'attach' request was used to connect to the debuggee, 'disconnect' does not terminate the debuggee. -This behavior can be controlled with the 'terminateDebuggee' argument (if supported by the debug adapter). *) +(** The `disconnect` request asks the debug adapter to disconnect from the debuggee (thus ending the debug session) and then to shut down itself (the debug adapter). +In addition, the debug adapter must terminate the debuggee if it was started with the `launch` request. If an `attach` request was used to connect to the debuggee, then the debug adapter must not terminate the debuggee. +This implicit behavior of when to terminate the debuggee can be overridden with the `terminateDebuggee` argument (which is only supported by a debug adapter if the corresponding capability `supportTerminateDebuggee` is true). *) module Disconnect_command = struct let type_ = "disconnect" module Arguments = struct - (** Arguments for 'disconnect' request. *) + (** Arguments for `disconnect` request. *) type t = { - restart : bool option [@default None]; (** A value of true indicates that this 'disconnect' request is part of a restart sequence. *) + restart : bool option [@default None]; (** A value of true indicates that this `disconnect` request is part of a restart sequence. *) terminate_debuggee : bool option [@key "terminateDebuggee"] [@default None]; (** Indicates whether the debuggee should be terminated when the debugger is disconnected. If unspecified, the debug adapter is free to do whatever it thinks is best. - The attribute is only honored by a debug adapter if the capability 'supportTerminateDebuggee' is true. *) + The attribute is only honored by a debug adapter if the corresponding capability `supportTerminateDebuggee` is true. *) + suspend_debuggee : bool option [@key "suspendDebuggee"] [@default None]; (** Indicates whether the debuggee should stay suspended when the debugger is disconnected. + If unspecified, the debuggee should resume execution. + The attribute is only honored by a debug adapter if the corresponding capability `supportSuspendDebuggee` is true. *) } [@@deriving make, yojson {strict = false}] end @@ -1616,15 +1796,17 @@ module Disconnect_command = struct end end -(** The 'terminate' request is sent from the client to the debug adapter in order to give the debuggee a chance for terminating itself. -Clients should only call this request if the capability 'supportsTerminateRequest' is true. *) +(** The `terminate` request is sent from the client to the debug adapter in order to shut down the debuggee gracefully. Clients should only call this request if the capability `supportsTerminateRequest` is true. +Typically a debug adapter implements `terminate` by sending a software signal which the debuggee intercepts in order to clean things up properly before terminating itself. +Please note that this request does not directly affect the state of the debug session: if the debuggee decides to veto the graceful shutdown for any reason by not terminating itself, then the debug session just continues. +Clients can surface the `terminate` request as an explicit command or they can integrate it into a two stage Stop command that first sends `terminate` to request a graceful shutdown, and if that fails uses `disconnect` for a forceful shutdown. *) module Terminate_command = struct let type_ = "terminate" module Arguments = struct - (** Arguments for 'terminate' request. *) + (** Arguments for `terminate` request. *) type t = { - restart : bool option [@default None]; (** A value of true indicates that this 'terminate' request is part of a restart sequence. *) + restart : bool option [@default None]; (** A value of true indicates that this `terminate` request is part of a restart sequence. *) } [@@deriving make, yojson {strict = false}] end @@ -1635,19 +1817,19 @@ module Terminate_command = struct end end -(** The 'breakpointLocations' request returns all possible locations for source breakpoints in a given range. -Clients should only call this request if the capability 'supportsBreakpointLocationsRequest' is true. *) +(** The `breakpointLocations` request returns all possible locations for source breakpoints in a given range. +Clients should only call this request if the corresponding capability `supportsBreakpointLocationsRequest` is true. *) module Breakpoint_locations_command = struct let type_ = "breakpointLocations" module Arguments = struct - (** Arguments for 'breakpointLocations' request. *) + (** Arguments for `breakpointLocations` request. *) type t = { - source : Source.t; (** The source location of the breakpoints; either 'source.path' or 'source.reference' must be specified. *) + source : Source.t; (** The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified. *) line : int; (** Start line of range to search possible breakpoint locations in. If only the line is specified, the request returns all possible locations in that line. *) - column : int option [@default None]; (** Optional start column of range to search possible breakpoint locations in. If no start column is given, the first column in the start line is assumed. *) - end_line : int option [@key "endLine"] [@default None]; (** Optional end line of range to search possible breakpoint locations in. If no end line is given, then the end line is assumed to be the start line. *) - end_column : int option [@key "endColumn"] [@default None]; (** Optional end column of range to search possible breakpoint locations in. If no end column is given, then it is assumed to be in the last column of the end line. *) + column : int option [@default None]; (** Start position within `line` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed. *) + end_line : int option [@key "endLine"] [@default None]; (** End line of range to search possible breakpoint locations in. If no end line is given, then the end line is assumed to be the start line. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position within `endLine` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no end column is given, the last position in the end line is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1662,14 +1844,14 @@ end (** Sets multiple breakpoints for a single source and clears all previous breakpoints in that source. To clear all breakpoint for a source, specify an empty array. -When a breakpoint is hit, a 'stopped' event (with reason 'breakpoint') is generated. *) +When a breakpoint is hit, a `stopped` event (with reason `breakpoint`) is generated. *) module Set_breakpoints_command = struct let type_ = "setBreakpoints" module Arguments = struct - (** Arguments for 'setBreakpoints' request. *) + (** Arguments for `setBreakpoints` request. *) type t = { - source : Source.t; (** The source location of the breakpoints; either 'source.path' or 'source.reference' must be specified. *) + source : Source.t; (** The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified. *) breakpoints : Source_breakpoint.t list option [@default None]; (** The code locations of the breakpoints. *) lines : int list option [@default None]; (** Deprecated: The code locations of the breakpoints. *) source_modified : bool option [@key "sourceModified"] [@default None]; (** A value of true indicates that the underlying source has been modified which results in new breakpoint locations. *) @@ -1680,7 +1862,7 @@ module Set_breakpoints_command = struct module Result = struct type t = { breakpoints : Breakpoint.t list; (** Information about the breakpoints. - The array elements are in the same order as the elements of the 'breakpoints' (or the deprecated 'lines') array in the arguments. *) + The array elements are in the same order as the elements of the `breakpoints` (or the deprecated `lines`) array in the arguments. *) } [@@deriving make, yojson {strict = false}] end @@ -1688,13 +1870,13 @@ end (** Replaces all existing function breakpoints with new function breakpoints. To clear all function breakpoints, specify an empty array. -When a function breakpoint is hit, a 'stopped' event (with reason 'function breakpoint') is generated. -Clients should only call this request if the capability 'supportsFunctionBreakpoints' is true. *) +When a function breakpoint is hit, a `stopped` event (with reason `function breakpoint`) is generated. +Clients should only call this request if the corresponding capability `supportsFunctionBreakpoints` is true. *) module Set_function_breakpoints_command = struct let type_ = "setFunctionBreakpoints" module Arguments = struct - (** Arguments for 'setFunctionBreakpoints' request. *) + (** Arguments for `setFunctionBreakpoints` request. *) type t = { breakpoints : Function_breakpoint.t list; (** The function names of the breakpoints. *) } @@ -1703,56 +1885,67 @@ module Set_function_breakpoints_command = struct module Result = struct type t = { - breakpoints : Breakpoint.t list; (** Information about the breakpoints. The array elements correspond to the elements of the 'breakpoints' array. *) + breakpoints : Breakpoint.t list; (** Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array. *) } [@@deriving make, yojson {strict = false}] end end -(** The request configures the debuggers response to thrown exceptions. -If an exception is configured to break, a 'stopped' event is fired (with reason 'exception'). -Clients should only call this request if the capability 'exceptionBreakpointFilters' returns one or more filters. *) +(** The request configures the debugger's response to thrown exceptions. Each of the `filters`, `filterOptions`, and `exceptionOptions` in the request are independent configurations to a debug adapter indicating a kind of exception to catch. An exception thrown in a program should result in a `stopped` event from the debug adapter (with reason `exception`) if any of the configured filters match. +Clients should only call this request if the corresponding capability `exceptionBreakpointFilters` returns one or more filters. *) module Set_exception_breakpoints_command = struct let type_ = "setExceptionBreakpoints" module Arguments = struct - (** Arguments for 'setExceptionBreakpoints' request. *) + (** Arguments for `setExceptionBreakpoints` request. *) type t = { - filters : string list; (** Set of exception filters specified by their ID. The set of all possible exception filters is defined by the 'exceptionBreakpointFilters' capability. The 'filter' and 'filterOptions' sets are additive. *) - filter_options : Exception_filter_options.t list option [@key "filterOptions"] [@default None]; (** 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. The 'filter' and 'filterOptions' sets are additive. *) + filters : string list; (** Set of exception filters specified by their ID. The set of all possible exception filters is defined by the `exceptionBreakpointFilters` capability. The `filter` and `filterOptions` sets are additive. *) + filter_options : Exception_filter_options.t list option [@key "filterOptions"] [@default None]; (** 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 corresponding capability `supportsExceptionFilterOptions` is true. The `filter` and `filterOptions` sets are additive. *) exception_options : Exception_options.t list option [@key "exceptionOptions"] [@default None]; (** Configuration options for selected exceptions. - The attribute is only honored by a debug adapter if the capability 'supportsExceptionOptions' is true. *) + The attribute is only honored by a debug adapter if the corresponding capability `supportsExceptionOptions` is true. *) } [@@deriving make, yojson {strict = false}] end module Result = struct - type t = Empty_dict.t - [@@deriving yojson] + type t = { + breakpoints : Breakpoint.t list option [@default None]; (** Information about the exception breakpoints or filters. + The breakpoints returned are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays in the arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information. *) + } + [@@deriving make, yojson {strict = false}] end end (** Obtains information on a possible data breakpoint that could be set on an expression or variable. -Clients should only call this request if the capability 'supportsDataBreakpoints' is true. *) +Clients should only call this request if the corresponding capability `supportsDataBreakpoints` is true. *) module Data_breakpoint_info_command = struct let type_ = "dataBreakpointInfo" module Arguments = struct - (** Arguments for 'dataBreakpointInfo' request. *) + (** Arguments for `dataBreakpointInfo` request. *) type t = { - variables_reference : int option [@key "variablesReference"] [@default None]; (** Reference to the Variable container if the data breakpoint is requested for a child of the container. *) - name : string; (** The name of the Variable's child to obtain data breakpoint information for. - If variablesReference isn’t provided, this can be an expression. *) + variables_reference : int option [@key "variablesReference"] [@default None]; (** Reference to the variable container if the data breakpoint is requested for a child of the container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) + name : string; (** The name of the variable's child to obtain data breakpoint information for. + If `variablesReference` isn't specified, this can be an expression, or an address if `asAddress` is also true. *) + frame_id : int option [@key "frameId"] [@default None]; (** When `name` is an expression, evaluate it in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. When `variablesReference` is specified, this property has no effect. *) + bytes : int option [@default None]; (** If specified, a debug adapter should return information for the range of memory extending `bytes` number of bytes from the address or variable specified by `name`. Breakpoints set using the resulting data ID should pause on data access anywhere within that range. + + Clients may set this property only if the `supportsDataBreakpointBytes` capability is true. *) + as_address : bool option [@key "asAddress"] [@default None]; (** If `true`, the `name` is a memory address and the debugger should interpret it as a decimal value, or hex value if it is prefixed with `0x`. + + Clients may set this property only if the `supportsDataBreakpointBytes` + capability is true. *) + mode : string option [@default None]; (** The mode of the desired breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. *) } [@@deriving make, yojson {strict = false}] end module Result = struct type t = { - data_id : string option [@key "dataId"]; (** An identifier for the data on which a data breakpoint can be registered with the setDataBreakpoints request or null if no data breakpoint is available. *) + data_id : string option [@key "dataId"]; (** An identifier for the data on which a data breakpoint can be registered with the `setDataBreakpoints` request or null if no data breakpoint is available. If a `variablesReference` or `frameId` is passed, the `dataId` is valid in the current suspended state, otherwise it's valid indefinitely. See 'Lifetime of Object References' in the Overview section for details. Breakpoints set using the `dataId` in the `setDataBreakpoints` request may outlive the lifetime of the associated `dataId`. *) description : string; (** UI string that describes on what data the breakpoint is set on or why a data breakpoint is not available. *) - access_types : Data_breakpoint_access_type.t list option [@key "accessTypes"] [@default None]; (** Optional attribute listing the available access types for a potential data breakpoint. A UI frontend could surface this information. *) - can_persist : bool option [@key "canPersist"] [@default None]; (** Optional attribute indicating that a potential data breakpoint could be persisted across sessions. *) + access_types : Data_breakpoint_access_type.t list option [@key "accessTypes"] [@default None]; (** Attribute lists the available access types for a potential data breakpoint. A UI client could surface this information. *) + can_persist : bool option [@key "canPersist"] [@default None]; (** Attribute indicates that a potential data breakpoint could be persisted across sessions. *) } [@@deriving make, yojson {strict = false}] end @@ -1760,13 +1953,13 @@ end (** Replaces all existing data breakpoints with new data breakpoints. To clear all data breakpoints, specify an empty array. -When a data breakpoint is hit, a 'stopped' event (with reason 'data breakpoint') is generated. -Clients should only call this request if the capability 'supportsDataBreakpoints' is true. *) +When a data breakpoint is hit, a `stopped` event (with reason `data breakpoint`) is generated. +Clients should only call this request if the corresponding capability `supportsDataBreakpoints` is true. *) module Set_data_breakpoints_command = struct let type_ = "setDataBreakpoints" module Arguments = struct - (** Arguments for 'setDataBreakpoints' request. *) + (** Arguments for `setDataBreakpoints` request. *) type t = { breakpoints : Data_breakpoint.t list; (** The contents of this array replaces all existing data breakpoints. An empty array clears all data breakpoints. *) } @@ -1775,21 +1968,21 @@ module Set_data_breakpoints_command = struct module Result = struct type t = { - breakpoints : Breakpoint.t list; (** Information about the data breakpoints. The array elements correspond to the elements of the input argument 'breakpoints' array. *) + breakpoints : Breakpoint.t list; (** Information about the data breakpoints. The array elements correspond to the elements of the input argument `breakpoints` array. *) } [@@deriving make, yojson {strict = false}] end end -(** Replaces all existing instruction breakpoints. Typically, instruction breakpoints would be set from a diassembly window. +(** Replaces all existing instruction breakpoints. Typically, instruction breakpoints would be set from a disassembly window. To clear all instruction breakpoints, specify an empty array. -When an instruction breakpoint is hit, a 'stopped' event (with reason 'instruction breakpoint') is generated. -Clients should only call this request if the capability 'supportsInstructionBreakpoints' is true. *) +When an instruction breakpoint is hit, a `stopped` event (with reason `instruction breakpoint`) is generated. +Clients should only call this request if the corresponding capability `supportsInstructionBreakpoints` is true. *) module Set_instruction_breakpoints_command = struct let type_ = "setInstructionBreakpoints" module Arguments = struct - (** Arguments for 'setInstructionBreakpoints' request *) + (** Arguments for `setInstructionBreakpoints` request *) type t = { breakpoints : Instruction_breakpoint.t list; (** The instruction references of the breakpoints *) } @@ -1798,44 +1991,45 @@ module Set_instruction_breakpoints_command = struct module Result = struct type t = { - breakpoints : Breakpoint.t list; (** Information about the breakpoints. The array elements correspond to the elements of the 'breakpoints' array. *) + breakpoints : Breakpoint.t list; (** Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array. *) } [@@deriving make, yojson {strict = false}] end end -(** The request starts the debuggee to run again. *) +(** The request resumes execution of all threads. If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true resumes only the specified thread. If not all threads were resumed, the `allThreadsContinued` attribute of the response should be set to false. *) module Continue_command = struct let type_ = "continue" module Arguments = struct - (** Arguments for 'continue' request. *) + (** Arguments for `continue` request. *) type t = { - thread_id : int [@key "threadId"]; (** Continue execution for the specified thread (if possible). - If the backend cannot continue on a single thread but will continue on all threads, it should set the 'allThreadsContinued' attribute in the response to true. *) + thread_id : int [@key "threadId"]; (** Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the argument `singleThread` is true, only the thread with this ID is resumed. *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, execution is resumed only for the thread with given `threadId`. *) } [@@deriving make, yojson {strict = false}] end module Result = struct type t = { - all_threads_continued : bool option [@key "allThreadsContinued"] [@default None]; (** If true, the 'continue' request has ignored the specified thread and continued all threads instead. - If this attribute is missing a value of 'true' is assumed for backward compatibility. *) + all_threads_continued : bool option [@key "allThreadsContinued"] [@default None]; (** The value true (or a missing property) signals to the client that all threads have been resumed. The value false indicates that not all threads were resumed. *) } [@@deriving make, yojson {strict = false}] end end -(** The request starts the debuggee to run again for one step. -The debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed. *) +(** The request executes one step (in the given granularity) for the specified thread and allows all other threads to run freely by resuming them. +If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming. +The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed. *) module Next_command = struct let type_ = "next" module Arguments = struct - (** Arguments for 'next' request. *) + (** Arguments for `next` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'next' for this thread. *) - granularity : Stepping_granularity.t option [@default None]; (** Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed. *) + thread_id : int [@key "threadId"]; (** Specifies the thread for which to resume execution for one step (of the given granularity). *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, all other suspended threads are not resumed. *) + granularity : Stepping_granularity.t option [@default None]; (** Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1846,21 +2040,23 @@ module Next_command = struct end end -(** The request starts the debuggee to step into a function/method if possible. -If it cannot step into a target, 'stepIn' behaves like 'next'. -The debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed. +(** The request resumes the given thread to step into a function/method and allows all other threads to run freely by resuming them. +If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming. +If the request cannot step into a target, `stepIn` behaves like the `next` request. +The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed. If there are multiple function/method calls (or other targets) on the source line, -the optional argument 'targetId' can be used to control into which target the 'stepIn' should occur. -The list of possible targets for a given source line can be retrieved via the 'stepInTargets' request. *) +the argument `targetId` can be used to control into which target the `stepIn` should occur. +The list of possible targets for a given source line can be retrieved via the `stepInTargets` request. *) module Step_in_command = struct let type_ = "stepIn" module Arguments = struct - (** Arguments for 'stepIn' request. *) + (** Arguments for `stepIn` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'stepIn' for this thread. *) - target_id : int option [@key "targetId"] [@default None]; (** Optional id of the target to step into. *) - granularity : Stepping_granularity.t option [@default None]; (** Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed. *) + thread_id : int [@key "threadId"]; (** Specifies the thread for which to resume execution for one step-into (of the given granularity). *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, all other suspended threads are not resumed. *) + target_id : int option [@key "targetId"] [@default None]; (** Id of the target to step into. *) + granularity : Stepping_granularity.t option [@default None]; (** Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1871,16 +2067,18 @@ module Step_in_command = struct end end -(** The request starts the debuggee to run again for one step. -The debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed. *) +(** The request resumes the given thread to step out (return) from a function/method and allows all other threads to run freely by resuming them. +If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming. +The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed. *) module Step_out_command = struct let type_ = "stepOut" module Arguments = struct - (** Arguments for 'stepOut' request. *) + (** Arguments for `stepOut` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'stepOut' for this thread. *) - granularity : Stepping_granularity.t option [@default None]; (** Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed. *) + thread_id : int [@key "threadId"]; (** Specifies the thread for which to resume execution for one step-out (of the given granularity). *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, all other suspended threads are not resumed. *) + granularity : Stepping_granularity.t option [@default None]; (** Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1891,17 +2089,19 @@ module Step_out_command = struct end end -(** The request starts the debuggee to run one step backwards. -The debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed. -Clients should only call this request if the capability 'supportsStepBack' is true. *) +(** The request executes one backward step (in the given granularity) for the specified thread and allows all other threads to run backward freely by resuming them. +If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming. +The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed. +Clients should only call this request if the corresponding capability `supportsStepBack` is true. *) module Step_back_command = struct let type_ = "stepBack" module Arguments = struct - (** Arguments for 'stepBack' request. *) + (** Arguments for `stepBack` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'stepBack' for this thread. *) - granularity : Stepping_granularity.t option [@default None]; (** Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed. *) + thread_id : int [@key "threadId"]; (** Specifies the thread for which to resume execution for one step backwards (of the given granularity). *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, all other suspended threads are not resumed. *) + granularity : Stepping_granularity.t option [@default None]; (** Stepping granularity to step. If no granularity is specified, a granularity of `statement` is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1912,15 +2112,16 @@ module Step_back_command = struct end end -(** The request starts the debuggee to run backward. -Clients should only call this request if the capability 'supportsStepBack' is true. *) +(** The request resumes backward execution of all threads. If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true resumes only the specified thread. If not all threads were resumed, the `allThreadsContinued` attribute of the response should be set to false. +Clients should only call this request if the corresponding capability `supportsStepBack` is true. *) module Reverse_continue_command = struct let type_ = "reverseContinue" module Arguments = struct - (** Arguments for 'reverseContinue' request. *) + (** Arguments for `reverseContinue` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'reverseContinue' for this thread. *) + thread_id : int [@key "threadId"]; (** Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the `singleThread` argument is true, only the thread with this ID is resumed. *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, backward execution is resumed only for the thread with given `threadId`. *) } [@@deriving make, yojson {strict = false}] end @@ -1931,16 +2132,16 @@ module Reverse_continue_command = struct end end -(** The request restarts execution of the specified stackframe. -The debug adapter first sends the response and then a 'stopped' event (with reason 'restart') after the restart has completed. -Clients should only call this request if the capability 'supportsRestartFrame' is true. *) +(** The request restarts execution of the specified stack frame. +The debug adapter first sends the response and then a `stopped` event (with reason `restart`) after the restart has completed. +Clients should only call this request if the corresponding capability `supportsRestartFrame` is true. *) module Restart_frame_command = struct let type_ = "restartFrame" module Arguments = struct - (** Arguments for 'restartFrame' request. *) + (** Arguments for `restartFrame` request. *) type t = { - frame_id : int [@key "frameId"]; (** Restart this stackframe. *) + frame_id : int [@key "frameId"]; (** Restart the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end @@ -1952,15 +2153,15 @@ module Restart_frame_command = struct end (** The request sets the location where the debuggee will continue to run. -This makes it possible to skip the execution of code or to executed code again. +This makes it possible to skip the execution of code or to execute code again. The code between the current location and the goto target is not executed but skipped. -The debug adapter first sends the response and then a 'stopped' event with reason 'goto'. -Clients should only call this request if the capability 'supportsGotoTargetsRequest' is true (because only then goto targets exist that can be passed as arguments). *) +The debug adapter first sends the response and then a `stopped` event with reason `goto`. +Clients should only call this request if the corresponding capability `supportsGotoTargetsRequest` is true (because only then goto targets exist that can be passed as arguments). *) module Goto_command = struct let type_ = "goto" module Arguments = struct - (** Arguments for 'goto' request. *) + (** Arguments for `goto` request. *) type t = { thread_id : int [@key "threadId"]; (** Set the goto target for this thread. *) target_id : int [@key "targetId"]; (** The location where the debuggee will continue to run. *) @@ -1975,12 +2176,12 @@ module Goto_command = struct end (** The request suspends the debuggee. -The debug adapter first sends the response and then a 'stopped' event (with reason 'pause') after the thread has been paused successfully. *) +The debug adapter first sends the response and then a `stopped` event (with reason `pause`) after the thread has been paused successfully. *) module Pause_command = struct let type_ = "pause" module Arguments = struct - (** Arguments for 'pause' request. *) + (** Arguments for `pause` request. *) type t = { thread_id : int [@key "threadId"]; (** Pause execution for this thread. *) } @@ -1994,60 +2195,60 @@ module Pause_command = struct end (** The request returns a stacktrace from the current execution state of a given thread. -A client can request all stack frames by omitting the startFrame and levels arguments. For performance conscious clients and if the debug adapter's 'supportsDelayedStackTraceLoading' capability is true, stack frames can be retrieved in a piecemeal way with the startFrame and levels arguments. The response of the stackTrace request may contain a totalFrames property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of totalFrames decide how to proceed. In any case a client should be prepared to receive less frames than requested, which is an indication that the end of the stack has been reached. *) +A client can request all stack frames by omitting the startFrame and levels arguments. For performance-conscious clients and if the corresponding capability `supportsDelayedStackTraceLoading` is true, stack frames can be retrieved in a piecemeal way with the `startFrame` and `levels` arguments. The response of the `stackTrace` request may contain a `totalFrames` property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of `totalFrames` decide how to proceed. In any case a client should be prepared to receive fewer frames than requested, which is an indication that the end of the stack has been reached. *) module Stack_trace_command = struct let type_ = "stackTrace" module Arguments = struct - (** Arguments for 'stackTrace' request. *) + (** Arguments for `stackTrace` request. *) type t = { thread_id : int [@key "threadId"]; (** Retrieve the stacktrace for this thread. *) start_frame : int option [@key "startFrame"] [@default None]; (** The index of the first frame to return; if omitted frames start at 0. *) levels : int option [@default None]; (** The maximum number of frames to return. If levels is not specified or 0, all frames are returned. *) format : Stack_frame_format.t option [@default None]; (** Specifies details on how to format the stack frames. - The attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true. *) + The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true. *) } [@@deriving make, yojson {strict = false}] end module Result = struct type t = { - stack_frames : Stack_frame.t list [@key "stackFrames"]; (** The frames of the stackframe. If the array has length zero, there are no stackframes available. + stack_frames : Stack_frame.t list [@key "stackFrames"]; (** The frames of the stack frame. If the array has length zero, there are no stack frames available. This means that there is no location information available. *) - total_frames : int option [@key "totalFrames"] [@default None]; (** The total number of frames available in the stack. If omitted or if totalFrames is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). Returning monotonically increasing totalFrames values for subsequent requests can be used to enforce paging in the client. *) + total_frames : int option [@key "totalFrames"] [@default None]; (** The total number of frames available in the stack. If omitted or if `totalFrames` is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). Returning monotonically increasing `totalFrames` values for subsequent requests can be used to enforce paging in the client. *) } [@@deriving make, yojson {strict = false}] end end -(** The request returns the variable scopes for a given stackframe ID. *) +(** The request returns the variable scopes for a given stack frame ID. *) module Scopes_command = struct let type_ = "scopes" module Arguments = struct - (** Arguments for 'scopes' request. *) + (** Arguments for `scopes` request. *) type t = { - frame_id : int [@key "frameId"]; (** Retrieve the scopes for this stackframe. *) + frame_id : int [@key "frameId"]; (** Retrieve the scopes for the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end module Result = struct type t = { - scopes : Scope.t list; (** The scopes of the stackframe. If the array has length zero, there are no scopes available. *) + scopes : Scope.t list; (** The scopes of the stack frame. If the array has length zero, there are no scopes available. *) } [@@deriving make, yojson {strict = false}] end end (** 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. *) +A filter can be used to limit the fetched children to either named or indexed children. *) module Variables_command = struct let type_ = "variables" module Arguments = struct module Filter = struct - (** Optional filter to limit the child variables to either named or indexed. If omitted, both types are fetched. *) + (** Filter to limit the child variables to either named or indexed. If omitted, both types are fetched. *) type t = | Indexed [@name "indexed"] | Named [@name "named"] @@ -2063,14 +2264,16 @@ module Variables_command = struct end - (** Arguments for 'variables' request. *) + (** Arguments for `variables` request. *) type t = { - variables_reference : int [@key "variablesReference"]; (** The Variable reference. *) - filter : Filter.t option [@default None]; (** Optional filter to limit the child variables to either named or indexed. If omitted, both types are fetched. *) - start : int option [@default None]; (** The index of the first variable to return; if omitted children start at 0. *) - count : int option [@default None]; (** The number of variables to return. If count is missing or 0, all variables are returned. *) + variables_reference : int [@key "variablesReference"]; (** The variable for which to retrieve its children. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) + filter : Filter.t option [@default None]; (** Filter to limit the child variables to either named or indexed. If omitted, both types are fetched. *) + start : int option [@default None]; (** The index of the first variable to return; if omitted children start at 0. + The attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true. *) + count : int option [@default None]; (** The number of variables to return. If count is missing or 0, all variables are returned. + The attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true. *) format : Value_format.t option [@default None]; (** Specifies details on how to format the Variable values. - The attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true. *) + The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true. *) } [@@deriving make, yojson {strict = false}] end @@ -2083,14 +2286,15 @@ module Variables_command = struct end end -(** Set the variable with the given name in the variable container to a new value. Clients should only call this request if the capability 'supportsSetVariable' is true. *) +(** Set the variable with the given name in the variable container to a new value. Clients should only call this request if the corresponding capability `supportsSetVariable` is true. +If a debug adapter implements both `setVariable` and `setExpression`, a client will only use `setExpression` if the variable has an `evaluateName` property. *) module Set_variable_command = struct let type_ = "setVariable" module Arguments = struct - (** Arguments for 'setVariable' request. *) + (** Arguments for `setVariable` request. *) type t = { - variables_reference : int [@key "variablesReference"]; (** The reference of the variable container. *) + variables_reference : int [@key "variablesReference"]; (** The reference of the variable container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) name : string; (** The name of the variable in the container. *) value : string; (** The value of the variable. *) format : Value_format.t option [@default None]; (** Specifies details on how to format the response value. *) @@ -2102,14 +2306,21 @@ module Set_variable_command = struct type t = { value : string; (** The new value of the variable. *) type_ : string option [@key "type"] [@default None]; (** The type of the new value. Typically shown in the UI when hovering over the value. *) - variables_reference : int option [@key "variablesReference"] [@default None]; (** If variablesReference is > 0, the new value is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. - The value should be less than or equal to 2147483647 (2^31-1). *) + variables_reference : int option [@key "variablesReference"] [@default None]; (** If `variablesReference` is > 0, the new value is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. + + If this property is included in the response, any `variablesReference` previously associated with the updated variable, and those of its children, are no longer valid. *) named_variables : int option [@key "namedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) + memory_reference : string option [@key "memoryReference"] [@default None]; (** A memory reference to a location appropriate for this result. + For pointer type eval results, this is generally a reference to the memory address contained in the pointer. + This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true. *) + value_location_reference : int option [@key "valueLocationReference"] [@default None]; (** A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end @@ -2120,11 +2331,11 @@ module Source_command = struct let type_ = "source" module Arguments = struct - (** Arguments for 'source' request. *) + (** Arguments for `source` request. *) type t = { - source : Source.t option [@default None]; (** Specifies the source content to load. Either source.path or source.sourceReference must be specified. *) - source_reference : int [@key "sourceReference"]; (** The reference to the source. This is the same as source.sourceReference. - This is provided for backward compatibility since old backends do not understand the 'source' attribute. *) + source : Source.t option [@default None]; (** Specifies the source content to load. Either `source.path` or `source.sourceReference` must be specified. *) + source_reference : int [@key "sourceReference"]; (** The reference to the source. This is the same as `source.sourceReference`. + This is provided for backward compatibility since old clients do not understand the `source` attribute. *) } [@@deriving make, yojson {strict = false}] end @@ -2132,7 +2343,7 @@ module Source_command = struct module Result = struct type t = { content : string; (** Content of the source reference. *) - mime_type : string option [@key "mimeType"] [@default None]; (** Optional content type (mime type) of the source. *) + mime_type : string option [@key "mimeType"] [@default None]; (** Content type (MIME type) of the source. *) } [@@deriving make, yojson {strict = false}] end @@ -2156,12 +2367,12 @@ module Threads_command = struct end (** The request terminates the threads with the given ids. -Clients should only call this request if the capability 'supportsTerminateThreadsRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsTerminateThreadsRequest` is true. *) module Terminate_threads_command = struct let type_ = "terminateThreads" module Arguments = struct - (** Arguments for 'terminateThreads' request. *) + (** Arguments for `terminateThreads` request. *) type t = { thread_ids : int list option [@key "threadIds"] [@default None]; (** Ids of threads to be terminated. *) } @@ -2175,15 +2386,15 @@ module Terminate_threads_command = struct end (** Modules can be retrieved from the debug adapter with this request which can either return all modules or a range of modules to support paging. -Clients should only call this request if the capability 'supportsModulesRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsModulesRequest` is true. *) module Modules_command = struct let type_ = "modules" module Arguments = struct - (** Arguments for 'modules' request. *) + (** Arguments for `modules` request. *) type t = { start_module : int option [@key "startModule"] [@default None]; (** The index of the first module to return; if omitted modules start at 0. *) - module_count : int option [@key "moduleCount"] [@default None]; (** The number of modules to return. If moduleCount is not specified or 0, all modules are returned. *) + module_count : int option [@key "moduleCount"] [@default None]; (** The number of modules to return. If `moduleCount` is not specified or 0, all modules are returned. *) } [@@deriving make, yojson {strict = false}] end @@ -2198,12 +2409,12 @@ module Modules_command = struct end (** Retrieves the set of all sources currently loaded by the debugged process. -Clients should only call this request if the capability 'supportsLoadedSourcesRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsLoadedSourcesRequest` is true. *) module Loaded_sources_command = struct let type_ = "loadedSources" module Arguments = struct - (** Arguments for 'loadedSources' request. *) + (** Arguments for `loadedSources` request. *) type t = Empty_dict.t [@@deriving yojson] end @@ -2216,19 +2427,20 @@ module Loaded_sources_command = struct end end -(** Evaluates the given expression in the context of the top most stack frame. +(** Evaluates the given expression in the context of a stack frame. The expression has access to any variables and arguments that are in scope. *) module Evaluate_command = struct let type_ = "evaluate" module Arguments = struct module Context = struct - (** The context in which the evaluate request is run. *) + (** The context in which the evaluate request is used. *) type t = | Watch [@name "watch"] | Repl [@name "repl"] | Hover [@name "hover"] | Clipboard [@name "clipboard"] + | Variables [@name "variables"] | Custom of string let of_yojson = function @@ -2236,6 +2448,7 @@ module Evaluate_command = struct | `String "repl" -> Ok Repl | `String "hover" -> Ok Hover | `String "clipboard" -> Ok Clipboard + | `String "variables" -> Ok Variables | `String str -> Ok (Custom str) | _ -> Error (print_exn_at_loc [%here]) let to_yojson = function @@ -2243,16 +2456,22 @@ module Evaluate_command = struct | Repl -> `String "repl" | Hover -> `String "hover" | Clipboard -> `String "clipboard" + | Variables -> `String "variables" | Custom str -> `String str end - (** Arguments for 'evaluate' request. *) + (** Arguments for `evaluate` request. *) type t = { expression : string; (** The expression to evaluate. *) frame_id : int option [@key "frameId"] [@default None]; (** Evaluate the expression in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. *) - context : Context.t option [@default None]; (** The context in which the evaluate request is run. *) - format : Value_format.t option [@default None]; (** Specifies details on how to format the Evaluate result. - The attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true. *) + line : int option [@default None]; (** The contextual line where the expression should be evaluated. In the 'hover' context, this should be set to the start of the expression being hovered. *) + column : int option [@default None]; (** The contextual column where the expression should be evaluated. This may be provided if `line` is also provided. + + It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + source : Source.t option [@default None]; (** The contextual source in which the `line` is found. This must be provided if `line` is provided. *) + context : Context.t option [@default None]; (** The context in which the evaluate request is used. *) + format : Value_format.t option [@default None]; (** Specifies details on how to format the result. + The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true. *) } [@@deriving make, yojson {strict = false}] end @@ -2260,33 +2479,36 @@ module Evaluate_command = struct module Result = struct type t = { result : string; (** The result of the evaluate request. *) - type_ : string option [@key "type"] [@default None]; (** The optional type of the evaluate result. - This attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request. *) - presentation_hint : Variable_presentation_hint.t option [@key "presentationHint"] [@default None]; (** Properties of a evaluate result that can be used to determine how to render the result in the UI. *) - variables_reference : int [@key "variablesReference"]; (** If variablesReference is > 0, the evaluate result is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. - The value should be less than or equal to 2147483647 (2^31-1). *) + type_ : string option [@key "type"] [@default None]; (** The type of the evaluate result. + This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true. *) + presentation_hint : Variable_presentation_hint.t option [@key "presentationHint"] [@default None]; (** Properties of an evaluate result that can be used to determine how to render the result in the UI. *) + variables_reference : int [@key "variablesReference"]; (** If `variablesReference` is > 0, the evaluate result is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) named_variables : int option [@key "namedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) - memory_reference : string option [@key "memoryReference"] [@default None]; (** Optional memory reference to a location appropriate for this result. + memory_reference : string option [@key "memoryReference"] [@default None]; (** A memory reference to a location appropriate for this result. For pointer type eval results, this is generally a reference to the memory address contained in the pointer. - This attribute should be returned by a debug adapter if the client has passed the value true for the 'supportsMemoryReferences' capability of the 'initialize' request. *) + This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true. *) + value_location_reference : int option [@key "valueLocationReference"] [@default None]; (** A reference that allows the client to request the location where the returned value is declared. For example, if a function pointer is returned, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end end -(** Evaluates the given 'value' expression and assigns it to the 'expression' which must be a modifiable l-value. +(** Evaluates the given `value` expression and assigns it to the `expression` which must be a modifiable l-value. The expressions have access to any variables and arguments that are in scope of the specified frame. -Clients should only call this request if the capability 'supportsSetExpression' is true. *) +Clients should only call this request if the corresponding capability `supportsSetExpression` is true. +If a debug adapter implements both `setExpression` and `setVariable`, a client uses `setExpression` if the variable has an `evaluateName` property. *) module Set_expression_command = struct let type_ = "setExpression" module Arguments = struct - (** Arguments for 'setExpression' request. *) + (** Arguments for `setExpression` request. *) type t = { expression : string; (** The l-value expression to assign to. *) value : string; (** The value expression to assign to the l-value expression. *) @@ -2299,57 +2521,61 @@ module Set_expression_command = struct module Result = struct type t = { value : string; (** The new value of the expression. *) - type_ : string option [@key "type"] [@default None]; (** The optional type of the value. - This attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request. *) + type_ : string option [@key "type"] [@default None]; (** The type of the value. + This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true. *) presentation_hint : Variable_presentation_hint.t option [@key "presentationHint"] [@default None]; (** Properties of a value that can be used to determine how to render the result in the UI. *) - variables_reference : int option [@key "variablesReference"] [@default None]; (** If variablesReference is > 0, the value is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. - The value should be less than or equal to 2147483647 (2^31-1). *) + variables_reference : int option [@key "variablesReference"] [@default None]; (** If `variablesReference` is > 0, the evaluate result is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) named_variables : int option [@key "namedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) + memory_reference : string option [@key "memoryReference"] [@default None]; (** A memory reference to a location appropriate for this result. + For pointer type eval results, this is generally a reference to the memory address contained in the pointer. + This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true. *) + value_location_reference : int option [@key "valueLocationReference"] [@default None]; (** A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end end -(** This request retrieves the possible stepIn targets for the specified stack frame. -These targets can be used in the 'stepIn' request. -The StepInTargets may only be called if the 'supportsStepInTargetsRequest' capability exists and is true. -Clients should only call this request if the capability 'supportsStepInTargetsRequest' is true. *) +(** This request retrieves the possible step-in targets for the specified stack frame. +These targets can be used in the `stepIn` request. +Clients should only call this request if the corresponding capability `supportsStepInTargetsRequest` is true. *) module Step_in_targets_command = struct let type_ = "stepInTargets" module Arguments = struct - (** Arguments for 'stepInTargets' request. *) + (** Arguments for `stepInTargets` request. *) type t = { - frame_id : int [@key "frameId"]; (** The stack frame for which to retrieve the possible stepIn targets. *) + frame_id : int [@key "frameId"]; (** The stack frame for which to retrieve the possible step-in targets. *) } [@@deriving make, yojson {strict = false}] end module Result = struct type t = { - targets : Step_in_target.t list; (** The possible stepIn targets of the specified source location. *) + targets : Step_in_target.t list; (** The possible step-in targets of the specified source location. *) } [@@deriving make, yojson {strict = false}] end end (** This request retrieves the possible goto targets for the specified source location. -These targets can be used in the 'goto' request. -Clients should only call this request if the capability 'supportsGotoTargetsRequest' is true. *) +These targets can be used in the `goto` request. +Clients should only call this request if the corresponding capability `supportsGotoTargetsRequest` is true. *) module Goto_targets_command = struct let type_ = "gotoTargets" module Arguments = struct - (** Arguments for 'gotoTargets' request. *) + (** Arguments for `gotoTargets` request. *) type t = { source : Source.t; (** The source location for which the goto targets are determined. *) line : int; (** The line location for which the goto targets are determined. *) - column : int option [@default None]; (** An optional column location for which the goto targets are determined. *) + column : int option [@default None]; (** The position within `line` for which the goto targets are determined. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) } [@@deriving make, yojson {strict = false}] end @@ -2363,17 +2589,17 @@ module Goto_targets_command = struct end (** Returns a list of possible completions for a given caret position and text. -Clients should only call this request if the capability 'supportsCompletionsRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsCompletionsRequest` is true. *) module Completions_command = struct let type_ = "completions" module Arguments = struct - (** Arguments for 'completions' request. *) + (** Arguments for `completions` request. *) type t = { frame_id : int option [@key "frameId"] [@default None]; (** Returns completions in the scope of this stack frame. If not specified, the completions are returned for the global scope. *) - text : string; (** One or more source lines. Typically this is the text a user has typed into the debug console before he asked for completion. *) - column : int; (** The character position for which to determine the completion proposals. *) - line : int option [@default None]; (** An optional line for which to determine the completion proposals. If missing the first line of the text is assumed. *) + text : string; (** One or more source lines. Typically this is the text users have typed into the debug console before they asked for completion. *) + column : int; (** The position within `text` for which to determine the completion proposals. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + line : int option [@default None]; (** A line for which to determine the completion proposals. If missing the first line of the text is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -2387,12 +2613,12 @@ module Completions_command = struct end (** Retrieves the details of the exception that caused this event to be raised. -Clients should only call this request if the capability 'supportsExceptionInfoRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsExceptionInfoRequest` is true. *) module Exception_info_command = struct let type_ = "exceptionInfo" module Arguments = struct - (** Arguments for 'exceptionInfo' request. *) + (** Arguments for `exceptionInfo` request. *) type t = { thread_id : int [@key "threadId"]; (** Thread for which exception information should be retrieved. *) } @@ -2402,7 +2628,7 @@ module Exception_info_command = struct module Result = struct type t = { exception_id : string [@key "exceptionId"]; (** ID of the exception that was thrown. *) - description : string option [@default None]; (** Descriptive text for the exception provided by the debug adapter. *) + description : string option [@default None]; (** Descriptive text for the exception. *) break_mode : Exception_break_mode.t [@key "breakMode"]; (** Mode that caused the exception notification to be raised. *) details : Exception_details.t option [@default None]; (** Detailed information about the exception. *) } @@ -2411,15 +2637,15 @@ module Exception_info_command = struct end (** Reads bytes from memory at the provided location. -Clients should only call this request if the capability 'supportsReadMemoryRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsReadMemoryRequest` is true. *) module Read_memory_command = struct let type_ = "readMemory" module Arguments = struct - (** Arguments for 'readMemory' request. *) + (** Arguments for `readMemory` request. *) type t = { memory_reference : string [@key "memoryReference"]; (** Memory reference to the base location from which data should be read. *) - offset : int option [@default None]; (** Optional offset (in bytes) to be applied to the reference location before reading data. Can be negative. *) + offset : int option [@default None]; (** Offset (in bytes) to be applied to the reference location before reading data. Can be negative. *) count : int; (** Number of bytes to read at the specified location and offset. *) } [@@deriving make, yojson {strict = false}] @@ -2428,26 +2654,52 @@ module Read_memory_command = struct module Result = struct type t = { address : string; (** The address of the first byte of data returned. - Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. *) + Treated as a hex value if prefixed with `0x`, or as a decimal value otherwise. *) unreadable_bytes : int option [@key "unreadableBytes"] [@default None]; (** The number of unreadable bytes encountered after the last successfully read byte. - This can be used to determine the number of bytes that must be skipped before a subsequent 'readMemory' request will succeed. *) - data : string option [@default None]; (** The bytes read from memory, encoded using base64. *) + This can be used to determine the number of bytes that should be skipped before a subsequent `readMemory` request succeeds. *) + data : string option [@default None]; (** The bytes read from memory, encoded using base64. If the decoded length of `data` is less than the requested `count` in the original `readMemory` request, and `unreadableBytes` is zero or omitted, then the client should assume it's reached the end of readable memory. *) + } + [@@deriving make, yojson {strict = false}] + end +end + +(** Writes bytes to memory at the provided location. +Clients should only call this request if the corresponding capability `supportsWriteMemoryRequest` is true. *) +module Write_memory_command = struct + let type_ = "writeMemory" + + module Arguments = struct + (** Arguments for `writeMemory` request. *) + type t = { + memory_reference : string [@key "memoryReference"]; (** Memory reference to the base location to which data should be written. *) + offset : int option [@default None]; (** Offset (in bytes) to be applied to the reference location before writing data. Can be negative. *) + allow_partial : bool option [@key "allowPartial"] [@default None]; (** Property to control partial writes. If true, the debug adapter should attempt to write memory even if the entire memory region is not writable. In such a case the debug adapter should stop after hitting the first byte of memory that cannot be written and return the number of bytes written in the response via the `offset` and `bytesWritten` properties. + If false or missing, a debug adapter should attempt to verify the region is writable before writing, and fail the response if it is not. *) + data : string; (** Bytes to write, encoded using base64. *) + } + [@@deriving make, yojson {strict = false}] + end + + module Result = struct + type t = { + offset : int option [@default None]; (** Property that should be returned when `allowPartial` is true to indicate the offset of the first byte of data successfully written. Can be negative. *) + bytes_written : int option [@key "bytesWritten"] [@default None]; (** Property that should be returned when `allowPartial` is true to indicate the number of bytes starting from address that were successfully written. *) } [@@deriving make, yojson {strict = false}] end end (** Disassembles code stored at the provided location. -Clients should only call this request if the capability 'supportsDisassembleRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsDisassembleRequest` is true. *) module Disassemble_command = struct let type_ = "disassemble" module Arguments = struct - (** Arguments for 'disassemble' request. *) + (** Arguments for `disassemble` request. *) type t = { memory_reference : string [@key "memoryReference"]; (** Memory reference to the base location containing the instructions to disassemble. *) - offset : int option [@default None]; (** Optional offset (in bytes) to be applied to the reference location before disassembling. Can be negative. *) - instruction_offset : int option [@key "instructionOffset"] [@default None]; (** Optional offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative. *) + offset : int option [@default None]; (** Offset (in bytes) to be applied to the reference location before disassembling. Can be negative. *) + instruction_offset : int option [@key "instructionOffset"] [@default None]; (** Offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative. *) instruction_count : int [@key "instructionCount"]; (** Number of instructions to disassemble starting at the specified location and offset. An adapter must return exactly this number of instructions - any unavailable instructions should be replaced with an implementation-defined 'invalid instruction' value. *) resolve_symbols : bool option [@key "resolveSymbols"] [@default None]; (** If true, the adapter should attempt to resolve memory addresses and other values to symbolic names. *) @@ -2463,3 +2715,27 @@ module Disassemble_command = struct end end +(** Looks up information about a location reference previously returned by the debug adapter. *) +module Locations_command = struct + let type_ = "locations" + + module Arguments = struct + (** Arguments for `locations` request. *) + type t = { + location_reference : int [@key "locationReference"]; (** Location reference to resolve. *) + } + [@@deriving make, yojson {strict = false}] + end + + module Result = struct + type t = { + source : Source.t; (** The source containing the location; either `source.path` or `source.sourceReference` must be specified. *) + line : int; (** The line number of the location. The client capability `linesStartAt1` determines whether it is 0- or 1-based. *) + column : int option [@default None]; (** Position of the location within the `line`. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed. *) + end_line : int option [@key "endLine"] [@default None]; (** End line of the location, present if the location refers to a range. The client capability `linesStartAt1` determines whether it is 0- or 1-based. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the location within `endLine`, present if the location refers to a range. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + } + [@@deriving make, yojson {strict = false}] + end +end + diff --git a/src/debug_protocol/debug_protocol.mli b/src/debug_protocol/debug_protocol.mli index 65c58bf..0097f64 100644 --- a/src/debug_protocol/debug_protocol.mli +++ b/src/debug_protocol/debug_protocol.mli @@ -17,7 +17,7 @@ module Protocol_message : sig (** Base class of requests, responses, and events. *) type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Type.t [@key "type"]; (** Message type. *) } [@@deriving make, yojson {strict = false}] @@ -32,7 +32,7 @@ module Request : sig end type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Type.t [@key "type"]; command : string; (** The command to execute. *) arguments : Yojson.Safe.t [@default `Assoc []]; (** Object containing arguments for the command. *) @@ -49,7 +49,7 @@ module Event : sig end type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Type.t [@key "type"]; event : string; (** Type of event. *) body : Yojson.Safe.t [@default `Assoc []]; (** Event-specific information. *) @@ -66,28 +66,29 @@ module Response : sig end module Message : sig - (** Contains the raw error in short form if 'success' is false. - This raw error might be interpreted by the frontend and is not shown in the UI. + (** Contains the raw error in short form if `success` is false. + This raw error might be interpreted by the client and is not shown in the UI. Some predefined values exist. *) type t = | Cancelled [@name "cancelled"] + | Not_stopped [@name "notStopped"] | Custom of string include JSONABLE with type t := t end type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Type.t [@key "type"]; request_seq : int; (** Sequence number of the corresponding request. *) success : bool; (** Outcome of the request. - If true, the request was successful and the 'body' attribute may contain the result of the request. - If the value is false, the attribute 'message' contains the error in short form and the 'body' may contain additional information (see 'ErrorResponse.body.error'). *) + If true, the request was successful and the `body` attribute may contain the result of the request. + If the value is false, the attribute `message` contains the error in short form and the `body` may contain additional information (see `ErrorResponse.body.error`). *) command : string; (** The command requested. *) - message : Message.t option [@default None]; (** Contains the raw error in short form if 'success' is false. - This raw error might be interpreted by the frontend and is not shown in the UI. + message : Message.t option [@default None]; (** Contains the raw error in short form if `success` is false. + This raw error might be interpreted by the client and is not shown in the UI. Some predefined values exist. *) - body : Yojson.Safe.t [@default `Assoc []]; (** Contains request result if success is true and optional error details if success is false. *) + body : Yojson.Safe.t [@default `Assoc []]; (** Contains request result if success is true and error details if success is false. *) } [@@deriving make, yojson {strict = false}] end @@ -101,14 +102,14 @@ module Message : sig (** A structured message object. Used to return errors from requests. *) type t = { - id : int; (** Unique identifier for the message. *) - format : string; (** A format string for the message. Embedded variables have the form '\{name\}'. + id : int; (** Unique (within a debug adapter implementation) identifier for the message. The purpose of these error IDs is to help extension authors that have the requirement that every user visible error message needs a corresponding error number, so that users or customer support can find information about the specific error more easily. *) + format : string; (** A format string for the message. Embedded variables have the form `\{name\}`. If variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes. *) variables : Variables.t option [@default None]; (** An object used as a dictionary for looking up the variables in the format string. *) send_telemetry : bool option [@key "sendTelemetry"] [@default None]; (** If true send to telemetry. *) show_user : bool option [@key "showUser"] [@default None]; (** If true show user. *) - url : string option [@default None]; (** An optional url where additional information about this message can be found. *) - url_label : string option [@key "urlLabel"] [@default None]; (** An optional label that is presented to the user as the UI for opening the url. *) + url : string option [@default None]; (** A url where additional information about this message can be found. *) + url_label : string option [@key "urlLabel"] [@default None]; (** A label that is presented to the user as the UI for opening the url. *) } [@@deriving make, yojson {strict = false}] end @@ -116,21 +117,21 @@ end module Error_response : sig module Body : sig type t = { - error : Message.t option [@default None]; (** An optional, structured error message. *) + error : Message.t option [@default None]; (** A structured error message. *) } [@@deriving make, yojson {strict = false}] end type t = { - seq : int; (** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. *) + seq : int; (** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. *) type_ : Response.Type.t [@key "type"]; request_seq : int; (** Sequence number of the corresponding request. *) success : bool; (** Outcome of the request. - If true, the request was successful and the 'body' attribute may contain the result of the request. - If the value is false, the attribute 'message' contains the error in short form and the 'body' may contain additional information (see 'ErrorResponse.body.error'). *) + If true, the request was successful and the `body` attribute may contain the result of the request. + If the value is false, the attribute `message` contains the error in short form and the `body` may contain additional information (see `ErrorResponse.body.error`). *) command : string; (** The command requested. *) - message : Response.Message.t option [@default None]; (** Contains the raw error in short form if 'success' is false. - This raw error might be interpreted by the frontend and is not shown in the UI. + message : Response.Message.t option [@default None]; (** Contains the raw error in short form if `success` is false. + This raw error might be interpreted by the client and is not shown in the UI. Some predefined values exist. *) body : Body.t; } @@ -138,19 +139,21 @@ module Error_response : sig end module Exception_breakpoints_filter : sig - (** An ExceptionBreakpointsFilter is shown in the UI as an filter option for configuring how exceptions are dealt with. *) + (** An `ExceptionBreakpointsFilter` is shown in the UI as an filter option for configuring how exceptions are dealt with. *) type t = { - filter : string; (** The internal ID of the filter option. This value is passed to the 'setExceptionBreakpoints' request. *) - label : string; (** The name of the filter option. This will be shown in the UI. *) - default : bool option [@default None]; (** Initial value of the filter option. If not specified a value 'false' is assumed. *) + filter : string; (** The internal ID of the filter option. This value is passed to the `setExceptionBreakpoints` request. *) + label : string; (** The name of the filter option. This is shown in the UI. *) + description : string option [@default None]; (** A help text providing additional information about the exception filter. This string is typically shown as a hover and can be translated. *) + default : bool option [@default None]; (** Initial value of the filter option. If not specified a value false is assumed. *) supports_condition : bool option [@key "supportsCondition"] [@default None]; (** Controls whether a condition can be specified for this filter option. If false or missing, a condition can not be set. *) + condition_description : string option [@key "conditionDescription"] [@default None]; (** A help text providing information about the condition. This string is shown as the placeholder text for a text box and can be translated. *) } [@@deriving make, yojson {strict = false}] end module Column_descriptor : sig module Type : sig - (** Datatype of values in this column. Defaults to 'string' if not specified. *) + (** Datatype of values in this column. Defaults to `string` if not specified. *) type t = | String [@name "string"] | Number [@name "number"] @@ -160,14 +163,14 @@ module Column_descriptor : sig include JSONABLE with type t := t end - (** A ColumnDescriptor specifies what module attribute to show in a column of the ModulesView, how to format it, + (** A `ColumnDescriptor` specifies what module attribute to show in a column of the modules view, how to format it, and what the column's label should be. It is only used if the underlying UI actually supports this level of customization. *) type t = { attribute_name : string [@key "attributeName"]; (** Name of the attribute rendered in this column. *) label : string; (** Header UI label of column. *) format : string option [@default None]; (** Format to use for the rendered values in this column. TBD how the format strings looks like. *) - type_ : Type.t option [@key "type"] [@default None]; (** Datatype of values in this column. Defaults to 'string' if not specified. *) + type_ : Type.t option [@key "type"] [@default None]; (** Datatype of values in this column. Defaults to `string` if not specified. *) width : int option [@default None]; (** Width of this column in characters (hint only). *) } [@@deriving make, yojson {strict = false}] @@ -184,90 +187,108 @@ module Checksum_algorithm : sig include JSONABLE with type t := t end +module Breakpoint_mode_applicability : sig + (** Describes one or more type of breakpoint a `BreakpointMode` applies to. This is a non-exhaustive enumeration and may expand as future breakpoint types are added. *) + type t = + | Source [@name "source"] + | Exception [@name "exception"] + | Data [@name "data"] + | Instruction [@name "instruction"] + | Custom of string + + include JSONABLE with type t := t +end + +module Breakpoint_mode : sig + (** A `BreakpointMode` is provided as a option when setting breakpoints on sources or instructions. *) + type t = { + mode : string; (** The internal ID of the mode. This value is passed to the `setBreakpoints` request. *) + label : string; (** The name of the breakpoint mode. This is shown in the UI. *) + description : string option [@default None]; (** A help text providing additional information about the breakpoint mode. This string is typically shown as a hover and can be translated. *) + applies_to : Breakpoint_mode_applicability.t list [@key "appliesTo"]; (** Describes one or more type of breakpoint this mode applies to. *) + } + [@@deriving make, yojson {strict = false}] +end + module Capabilities : sig (** Information about the capabilities of a debug adapter. *) type t = { - supports_configuration_done_request : bool option [@key "supportsConfigurationDoneRequest"] [@default None]; (** The debug adapter supports the 'configurationDone' request. *) + supports_configuration_done_request : bool option [@key "supportsConfigurationDoneRequest"] [@default None]; (** The debug adapter supports the `configurationDone` request. *) supports_function_breakpoints : bool option [@key "supportsFunctionBreakpoints"] [@default None]; (** The debug adapter supports function breakpoints. *) supports_conditional_breakpoints : bool option [@key "supportsConditionalBreakpoints"] [@default None]; (** The debug adapter supports conditional breakpoints. *) supports_hit_conditional_breakpoints : bool option [@key "supportsHitConditionalBreakpoints"] [@default None]; (** The debug adapter supports breakpoints that break execution after a specified number of hits. *) - supports_evaluate_for_hovers : bool option [@key "supportsEvaluateForHovers"] [@default None]; (** The debug adapter supports a (side effect free) evaluate request for data hovers. *) - exception_breakpoint_filters : Exception_breakpoints_filter.t list option [@key "exceptionBreakpointFilters"] [@default None]; (** Available exception filter options for the 'setExceptionBreakpoints' request. *) - supports_step_back : bool option [@key "supportsStepBack"] [@default None]; (** The debug adapter supports stepping back via the 'stepBack' and 'reverseContinue' requests. *) + supports_evaluate_for_hovers : bool option [@key "supportsEvaluateForHovers"] [@default None]; (** The debug adapter supports a (side effect free) `evaluate` request for data hovers. *) + exception_breakpoint_filters : Exception_breakpoints_filter.t list option [@key "exceptionBreakpointFilters"] [@default None]; (** Available exception filter options for the `setExceptionBreakpoints` request. *) + supports_step_back : bool option [@key "supportsStepBack"] [@default None]; (** The debug adapter supports stepping back via the `stepBack` and `reverseContinue` requests. *) supports_set_variable : bool option [@key "supportsSetVariable"] [@default None]; (** The debug adapter supports setting a variable to a value. *) supports_restart_frame : bool option [@key "supportsRestartFrame"] [@default None]; (** The debug adapter supports restarting a frame. *) - supports_goto_targets_request : bool option [@key "supportsGotoTargetsRequest"] [@default None]; (** The debug adapter supports the 'gotoTargets' request. *) - supports_step_in_targets_request : bool option [@key "supportsStepInTargetsRequest"] [@default None]; (** The debug adapter supports the 'stepInTargets' request. *) - supports_completions_request : bool option [@key "supportsCompletionsRequest"] [@default None]; (** The debug adapter supports the 'completions' request. *) - completion_trigger_characters : string list option [@key "completionTriggerCharacters"] [@default None]; (** The set of characters that should trigger completion in a REPL. If not specified, the UI should assume the '.' character. *) - supports_modules_request : bool option [@key "supportsModulesRequest"] [@default None]; (** The debug adapter supports the 'modules' request. *) + supports_goto_targets_request : bool option [@key "supportsGotoTargetsRequest"] [@default None]; (** The debug adapter supports the `gotoTargets` request. *) + supports_step_in_targets_request : bool option [@key "supportsStepInTargetsRequest"] [@default None]; (** The debug adapter supports the `stepInTargets` request. *) + supports_completions_request : bool option [@key "supportsCompletionsRequest"] [@default None]; (** The debug adapter supports the `completions` request. *) + completion_trigger_characters : string list option [@key "completionTriggerCharacters"] [@default None]; (** The set of characters that should trigger completion in a REPL. If not specified, the UI should assume the `.` character. *) + supports_modules_request : bool option [@key "supportsModulesRequest"] [@default None]; (** The debug adapter supports the `modules` request. *) additional_module_columns : Column_descriptor.t list option [@key "additionalModuleColumns"] [@default None]; (** The set of additional module information exposed by the debug adapter. *) supported_checksum_algorithms : Checksum_algorithm.t list option [@key "supportedChecksumAlgorithms"] [@default None]; (** Checksum algorithms supported by the debug adapter. *) - supports_restart_request : bool option [@key "supportsRestartRequest"] [@default None]; (** The debug adapter supports the 'restart' request. In this case a client should not implement 'restart' by terminating and relaunching the adapter but by calling the RestartRequest. *) - supports_exception_options : bool option [@key "supportsExceptionOptions"] [@default None]; (** The debug adapter supports 'exceptionOptions' on the setExceptionBreakpoints request. *) - supports_value_formatting_options : bool option [@key "supportsValueFormattingOptions"] [@default None]; (** The debug adapter supports a 'format' attribute on the stackTraceRequest, variablesRequest, and evaluateRequest. *) - supports_exception_info_request : bool option [@key "supportsExceptionInfoRequest"] [@default None]; (** The debug adapter supports the 'exceptionInfo' request. *) - support_terminate_debuggee : bool option [@key "supportTerminateDebuggee"] [@default None]; (** The debug adapter supports the 'terminateDebuggee' attribute on the 'disconnect' request. *) - supports_delayed_stack_trace_loading : bool option [@key "supportsDelayedStackTraceLoading"] [@default None]; (** The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and an optional 'totalFrames' result of the 'StackTrace' request are supported. *) - supports_loaded_sources_request : bool option [@key "supportsLoadedSourcesRequest"] [@default None]; (** The debug adapter supports the 'loadedSources' request. *) - supports_log_points : bool option [@key "supportsLogPoints"] [@default None]; (** The debug adapter supports logpoints by interpreting the 'logMessage' attribute of the SourceBreakpoint. *) - supports_terminate_threads_request : bool option [@key "supportsTerminateThreadsRequest"] [@default None]; (** The debug adapter supports the 'terminateThreads' request. *) - supports_set_expression : bool option [@key "supportsSetExpression"] [@default None]; (** The debug adapter supports the 'setExpression' request. *) - supports_terminate_request : bool option [@key "supportsTerminateRequest"] [@default None]; (** The debug adapter supports the 'terminate' request. *) + supports_restart_request : bool option [@key "supportsRestartRequest"] [@default None]; (** The debug adapter supports the `restart` request. In this case a client should not implement `restart` by terminating and relaunching the adapter but by calling the `restart` request. *) + supports_exception_options : bool option [@key "supportsExceptionOptions"] [@default None]; (** The debug adapter supports `exceptionOptions` on the `setExceptionBreakpoints` request. *) + supports_value_formatting_options : bool option [@key "supportsValueFormattingOptions"] [@default None]; (** The debug adapter supports a `format` attribute on the `stackTrace`, `variables`, and `evaluate` requests. *) + supports_exception_info_request : bool option [@key "supportsExceptionInfoRequest"] [@default None]; (** The debug adapter supports the `exceptionInfo` request. *) + support_terminate_debuggee : bool option [@key "supportTerminateDebuggee"] [@default None]; (** The debug adapter supports the `terminateDebuggee` attribute on the `disconnect` request. *) + support_suspend_debuggee : bool option [@key "supportSuspendDebuggee"] [@default None]; (** The debug adapter supports the `suspendDebuggee` attribute on the `disconnect` request. *) + supports_delayed_stack_trace_loading : bool option [@key "supportsDelayedStackTraceLoading"] [@default None]; (** The debug adapter supports the delayed loading of parts of the stack, which requires that both the `startFrame` and `levels` arguments and the `totalFrames` result of the `stackTrace` request are supported. *) + supports_loaded_sources_request : bool option [@key "supportsLoadedSourcesRequest"] [@default None]; (** The debug adapter supports the `loadedSources` request. *) + supports_log_points : bool option [@key "supportsLogPoints"] [@default None]; (** The debug adapter supports log points by interpreting the `logMessage` attribute of the `SourceBreakpoint`. *) + supports_terminate_threads_request : bool option [@key "supportsTerminateThreadsRequest"] [@default None]; (** The debug adapter supports the `terminateThreads` request. *) + supports_set_expression : bool option [@key "supportsSetExpression"] [@default None]; (** The debug adapter supports the `setExpression` request. *) + supports_terminate_request : bool option [@key "supportsTerminateRequest"] [@default None]; (** The debug adapter supports the `terminate` request. *) supports_data_breakpoints : bool option [@key "supportsDataBreakpoints"] [@default None]; (** The debug adapter supports data breakpoints. *) - supports_read_memory_request : bool option [@key "supportsReadMemoryRequest"] [@default None]; (** The debug adapter supports the 'readMemory' request. *) - supports_disassemble_request : bool option [@key "supportsDisassembleRequest"] [@default None]; (** The debug adapter supports the 'disassemble' request. *) - supports_cancel_request : bool option [@key "supportsCancelRequest"] [@default None]; (** The debug adapter supports the 'cancel' request. *) - supports_breakpoint_locations_request : bool option [@key "supportsBreakpointLocationsRequest"] [@default None]; (** The debug adapter supports the 'breakpointLocations' request. *) - supports_clipboard_context : bool option [@key "supportsClipboardContext"] [@default None]; (** The debug adapter supports the 'clipboard' context value in the 'evaluate' request. *) - supports_stepping_granularity : bool option [@key "supportsSteppingGranularity"] [@default None]; (** The debug adapter supports stepping granularities (argument 'granularity') for the stepping requests. *) + supports_read_memory_request : bool option [@key "supportsReadMemoryRequest"] [@default None]; (** The debug adapter supports the `readMemory` request. *) + supports_write_memory_request : bool option [@key "supportsWriteMemoryRequest"] [@default None]; (** The debug adapter supports the `writeMemory` request. *) + supports_disassemble_request : bool option [@key "supportsDisassembleRequest"] [@default None]; (** The debug adapter supports the `disassemble` request. *) + supports_cancel_request : bool option [@key "supportsCancelRequest"] [@default None]; (** The debug adapter supports the `cancel` request. *) + supports_breakpoint_locations_request : bool option [@key "supportsBreakpointLocationsRequest"] [@default None]; (** The debug adapter supports the `breakpointLocations` request. *) + supports_clipboard_context : bool option [@key "supportsClipboardContext"] [@default None]; (** The debug adapter supports the `clipboard` context value in the `evaluate` request. *) + supports_stepping_granularity : bool option [@key "supportsSteppingGranularity"] [@default None]; (** The debug adapter supports stepping granularities (argument `granularity`) for the stepping requests. *) supports_instruction_breakpoints : bool option [@key "supportsInstructionBreakpoints"] [@default None]; (** The debug adapter supports adding breakpoints based on instruction references. *) - supports_exception_filter_options : bool option [@key "supportsExceptionFilterOptions"] [@default None]; (** The debug adapter supports 'filterOptions' as an argument on the 'setExceptionBreakpoints' request. *) + supports_exception_filter_options : bool option [@key "supportsExceptionFilterOptions"] [@default None]; (** The debug adapter supports `filterOptions` as an argument on the `setExceptionBreakpoints` request. *) + supports_single_thread_execution_requests : bool option [@key "supportsSingleThreadExecutionRequests"] [@default None]; (** The debug adapter supports the `singleThread` property on the execution requests (`continue`, `next`, `stepIn`, `stepOut`, `reverseContinue`, `stepBack`). *) + supports_data_breakpoint_bytes : bool option [@key "supportsDataBreakpointBytes"] [@default None]; (** The debug adapter supports the `asAddress` and `bytes` fields in the `dataBreakpointInfo` request. *) + breakpoint_modes : Breakpoint_mode.t list option [@key "breakpointModes"] [@default None]; (** Modes of breakpoints supported by the debug adapter, such as 'hardware' or 'software'. If present, the client may allow the user to select a mode and include it in its `setBreakpoints` request. + + Clients may present the first applicable mode in this array as the 'default' mode in gestures that set breakpoints. *) + supports_ansistyling : bool option [@key "supportsANSIStyling"] [@default None]; (** The debug adapter supports ANSI escape sequences in styling of `OutputEvent.output` and `Variable.value` fields. *) } [@@deriving make, yojson {strict = false}] end module Module : sig (** A Module object represents a row in the modules view. - Two attributes are mandatory: an id identifies a module in the modules view and is used in a ModuleEvent for identifying a module for adding, updating or deleting. - The name is used to minimally render the module in the UI. + The `id` attribute identifies a module in the modules view and is used in a `module` event for identifying a module for adding, updating or deleting. + The `name` attribute is used to minimally render the module in the UI. - Additional attributes can be added to the module. They will show up in the module View if they have a corresponding ColumnDescriptor. + Additional attributes can be added to the module. They show up in the module view if they have a corresponding `ColumnDescriptor`. - To avoid an unnecessary proliferation of additional attributes with similar semantics but different names - we recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found. *) + To avoid an unnecessary proliferation of additional attributes with similar semantics but different names, we recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found. *) type t = { id : Int_or_string.t; (** Unique identifier for the module. *) name : string; (** A name of the module. *) - path : string option [@default None]; (** optional but recommended attributes. - always try to use these first before introducing additional attributes. - - Logical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module. *) + path : string option [@default None]; (** Logical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module. *) is_optimized : bool option [@key "isOptimized"] [@default None]; (** True if the module is optimized. *) is_user_code : bool option [@key "isUserCode"] [@default None]; (** True if the module is considered 'user code' by a debugger that supports 'Just My Code'. *) version : string option [@default None]; (** Version of Module. *) - symbol_status : string option [@key "symbolStatus"] [@default None]; (** User understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc. *) + symbol_status : string option [@key "symbolStatus"] [@default None]; (** User-understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc.) *) symbol_file_path : string option [@key "symbolFilePath"] [@default None]; (** Logical full path to the symbol file. The exact definition is implementation defined. *) - date_time_stamp : string option [@key "dateTimeStamp"] [@default None]; (** Module created or modified. *) + date_time_stamp : string option [@key "dateTimeStamp"] [@default None]; (** Module created or modified, encoded as a RFC 3339 timestamp. *) address_range : string option [@key "addressRange"] [@default None]; (** Address range covered by this module. *) } [@@deriving make, yojson {strict = false}] end -module Modules_view_descriptor : sig - (** The ModulesViewDescriptor is the container for all declarative configuration options of a ModuleView. - For now it only specifies the columns to be shown in the modules view. *) - type t = { - columns : Column_descriptor.t list; - } - [@@deriving make, yojson {strict = false}] -end - module Thread : sig (** A Thread *) type t = { id : int; (** Unique identifier for the thread. *) - name : string; (** A name of the thread. *) + name : string; (** The name of the thread. *) } [@@deriving make, yojson {strict = false}] end @@ -276,15 +297,15 @@ module Checksum : sig (** The checksum of an item calculated by the specified algorithm. *) type t = { algorithm : Checksum_algorithm.t; (** The algorithm used to calculate this checksum. *) - checksum : string; (** Value of the checksum. *) + checksum : string; (** Value of the checksum, encoded as a hexadecimal value. *) } [@@deriving make, yojson {strict = false}] end module Source : sig module Presentation_hint : sig - (** An optional hint for how to present the source in the UI. - A value of 'deemphasize' can be used to indicate that the source is not available or that it is skipped on stepping. *) + (** A hint for how to present the source in the UI. + A value of `deemphasize` can be used to indicate that the source is not available or that it is skipped on stepping. *) type t = | Normal [@name "normal"] | Emphasize [@name "emphasize"] @@ -293,21 +314,21 @@ module Source : sig include JSONABLE with type t := t end - (** A Source is a descriptor for source code. - It is returned from the debug adapter as part of a StackFrame and it is used by clients when specifying breakpoints. *) + (** A `Source` is a descriptor for source code. + It is returned from the debug adapter as part of a `StackFrame` and it is used by clients when specifying breakpoints. *) type t = { name : string option [@default None]; (** The short name of the source. Every source returned from the debug adapter has a name. When sending a source to the debug adapter this name is optional. *) path : string option [@default None]; (** The path of the source to be shown in the UI. - It is only used to locate and load the content of the source if no sourceReference is specified (or its value is 0). *) - source_reference : int option [@key "sourceReference"] [@default None]; (** If sourceReference > 0 the contents of the source must be retrieved through the SourceRequest (even if a path is specified). - A sourceReference is only valid for a session, so it must not be used to persist a source. + It is only used to locate and load the content of the source if no `sourceReference` is specified (or its value is 0). *) + source_reference : int option [@key "sourceReference"] [@default None]; (** If the value > 0 the contents of the source must be retrieved through the `source` request (even if a path is specified). + Since a `sourceReference` is only valid for a session, it can not be used to persist a source. The value should be less than or equal to 2147483647 (2^31-1). *) - presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** An optional hint for how to present the source in the UI. - A value of 'deemphasize' can be used to indicate that the source is not available or that it is skipped on stepping. *) - origin : string option [@default None]; (** The (optional) origin of this source: possible values 'internal module', 'inlined content from source map', etc. *) - sources : t list option [@default None]; (** An optional list of sources that are related to this source. These may be the source that generated this source. *) - adapter_data : Any.t option [@key "adapterData"] [@default None]; (** Optional data that a debug adapter might want to loop through the client. + presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** A hint for how to present the source in the UI. + A value of `deemphasize` can be used to indicate that the source is not available or that it is skipped on stepping. *) + origin : string option [@default None]; (** The origin of this source. For example, 'internal module', 'inlined content from source map', etc. *) + sources : t list option [@default None]; (** A list of sources that are related to this source. These may be the source that generated this source. *) + adapter_data : Any.t option [@key "adapterData"] [@default None]; (** Additional data that a debug adapter might want to loop through the client. The client should leave the data intact and persist it across sessions. The client should not interpret the data. *) checksums : Checksum.t list option [@default None]; (** The checksums associated with this file. *) } @@ -316,8 +337,8 @@ end module Stack_frame : sig module Presentation_hint : sig - (** An optional hint for how to present this frame in the UI. - A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way. *) + (** A hint for how to present this frame in the UI. + A value of `label` can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of `subtle` can be used to change the appearance of a frame in a 'subtle' way. *) type t = | Normal [@name "normal"] | Label [@name "label"] @@ -329,48 +350,50 @@ module Stack_frame : sig (** A Stackframe contains the source location. *) type t = { id : int; (** An identifier for the stack frame. It must be unique across all threads. - This id can be used to retrieve the scopes of the frame with the 'scopesRequest' or to restart the execution of a stackframe. *) + This id can be used to retrieve the scopes of the frame with the `scopes` request or to restart the execution of a stack frame. *) name : string; (** The name of the stack frame, typically a method name. *) - source : Source.t option [@default None]; (** The optional source of the frame. *) - line : int; (** The line within the file of the frame. If source is null or doesn't exist, line is 0 and must be ignored. *) - column : int; (** The column within the line. If source is null or doesn't exist, column is 0 and must be ignored. *) - end_line : int option [@key "endLine"] [@default None]; (** An optional end line of the range covered by the stack frame. *) - end_column : int option [@key "endColumn"] [@default None]; (** An optional end column of the range covered by the stack frame. *) - instruction_pointer_reference : string option [@key "instructionPointerReference"] [@default None]; (** Optional memory reference for the current instruction pointer in this frame. *) + source : Source.t option [@default None]; (** The source of the frame. *) + line : int; (** The line within the source of the frame. If the source attribute is missing or doesn't exist, `line` is 0 and should be ignored by the client. *) + column : int; (** Start position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If attribute `source` is missing or doesn't exist, `column` is 0 and should be ignored by the client. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the range covered by the stack frame. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + can_restart : bool option [@key "canRestart"] [@default None]; (** Indicates whether this frame can be restarted with the `restartFrame` request. Clients should only use this if the debug adapter supports the `restart` request and the corresponding capability `supportsRestartFrame` is true. If a debug adapter has this capability, then `canRestart` defaults to `true` if the property is absent. *) + instruction_pointer_reference : string option [@key "instructionPointerReference"] [@default None]; (** A memory reference for the current instruction pointer in this frame. *) module_id : Int_or_string.t option [@key "moduleId"] [@default None]; (** The module associated with this frame, if any. *) - presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** An optional hint for how to present this frame in the UI. - A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way. *) + presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** A hint for how to present this frame in the UI. + A value of `label` can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of `subtle` can be used to change the appearance of a frame in a 'subtle' way. *) } [@@deriving make, yojson {strict = false}] end module Scope : sig module Presentation_hint : sig - (** An optional hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI. *) + (** A hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI. *) type t = | Arguments [@name "arguments"] | Locals [@name "locals"] | Registers [@name "registers"] + | Return_value [@name "returnValue"] | Custom of string include JSONABLE with type t := t end - (** A Scope is a named container for variables. Optionally a scope can map to a source or a range within a source. *) + (** A `Scope` is a named container for variables. Optionally a scope can map to a source or a range within a source. *) type t = { name : string; (** Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This string is shown in the UI as is and can be translated. *) - presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** An optional hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI. *) - variables_reference : int [@key "variablesReference"]; (** The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest. *) + presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** A hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI. *) + variables_reference : int [@key "variablesReference"]; (** The variables of this scope can be retrieved by passing the value of `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) named_variables : int option [@key "namedVariables"] [@default None]; (** 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. *) + The client can use this information to present the variables in a paged UI and fetch them in chunks. *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** 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. *) + The client can use this information to present the variables in a paged UI and fetch them in chunks. *) expensive : bool; (** If true, the number of variables in this scope is large or expensive to retrieve. *) - source : Source.t option [@default None]; (** Optional source for this scope. *) - line : int option [@default None]; (** Optional start line of the range covered by this scope. *) - column : int option [@default None]; (** Optional start column of the range covered by this scope. *) - end_line : int option [@key "endLine"] [@default None]; (** Optional end line of the range covered by this scope. *) - end_column : int option [@key "endColumn"] [@default None]; (** Optional end column of the range covered by this scope. *) + source : Source.t option [@default None]; (** The source for this scope. *) + line : int option [@default None]; (** The start line of the range covered by this scope. *) + column : int option [@default None]; (** Start position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the range covered by this scope. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) } [@@deriving make, yojson {strict = false}] end @@ -404,6 +427,7 @@ module Variable_presentation_hint : sig | Has_object_id [@name "hasObjectId"] | Can_have_object_id [@name "canHaveObjectId"] | Has_side_effects [@name "hasSideEffects"] + | Has_data_breakpoint [@name "hasDataBreakpoint"] | Custom of string include JSONABLE with type t := t @@ -422,78 +446,95 @@ module Variable_presentation_hint : sig include JSONABLE with type t := t end - (** Optional properties of a variable that can be used to determine how to render the variable in the UI. *) + (** Properties of a variable that can be used to determine how to render the variable in the UI. *) type t = { kind : Kind.t option [@default None]; (** The kind of variable. Before introducing additional values, try to use the listed values. *) attributes : Attributes.t list option [@default None]; (** Set of attributes represented as an array of strings. Before introducing additional values, try to use the listed values. *) visibility : Visibility.t option [@default None]; (** Visibility of variable. Before introducing additional values, try to use the listed values. *) + lazy_ : bool option [@key "lazy"] [@default None]; (** If true, clients can present the variable with a UI that supports a specific gesture to trigger its evaluation. + This mechanism can be used for properties that require executing code when retrieving their value and where the code execution can be expensive and/or produce side-effects. A typical example are properties based on a getter function. + Please note that in addition to the `lazy` flag, the variable's `variablesReference` is expected to refer to a variable that will provide the value through another `variable` request. *) } [@@deriving make, yojson {strict = false}] end module Variable : sig (** A Variable is a name/value pair. - Optionally a variable can have a 'type' that is shown if space permits or when hovering over the variable's name. - An optional 'kind' is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private. - If the value is structured (has children), a handle is provided to retrieve the children with the VariablesRequest. - If the number of named or indexed children is large, the numbers should be returned via the optional 'namedVariables' and 'indexedVariables' attributes. - The client can use this optional information to present the children in a paged UI and fetch them in chunks. *) + The `type` attribute is shown if space permits or when hovering over the variable's name. + The `kind` attribute is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private. + If the value is structured (has children), a handle is provided to retrieve the children with the `variables` request. + If the number of named or indexed children is large, the numbers should be returned via the `namedVariables` and `indexedVariables` attributes. + The client can use this information to present the children in a paged UI and fetch them in chunks. *) type t = { name : string; (** The variable's name. *) - value : string; (** The variable's value. This can be a multi-line text, e.g. for a function the body of a function. *) + value : string; (** The variable's value. + This can be a multi-line text, e.g. for a function the body of a function. + For structured variables (which do not have a simple value), it is recommended to provide a one-line representation of the structured object. This helps to identify the structured object in the collapsed state when its children are not yet visible. + An empty string can be used if no value should be shown in the UI. *) type_ : string option [@key "type"] [@default None]; (** The type of the variable's value. Typically shown in the UI when hovering over the value. - This attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request. *) + This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true. *) presentation_hint : Variable_presentation_hint.t option [@key "presentationHint"] [@default None]; (** Properties of a variable that can be used to determine how to render the variable in the UI. *) - evaluate_name : string option [@key "evaluateName"] [@default None]; (** Optional evaluatable name of this variable which can be passed to the 'EvaluateRequest' to fetch the variable's value. *) - variables_reference : int [@key "variablesReference"]; (** If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. *) + evaluate_name : string option [@key "evaluateName"] [@default None]; (** The evaluatable name of this variable which can be passed to the `evaluate` request to fetch the variable's value. *) + variables_reference : int [@key "variablesReference"]; (** If `variablesReference` is > 0, the variable is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) named_variables : int option [@key "namedVariables"] [@default None]; (** The number of named child variables. - The client can use this optional information to present the children in a paged UI and fetch them in chunks. *) + The client can use this information to present the children in a paged UI and fetch them in chunks. *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** The number of indexed child variables. - The client can use this optional information to present the children in a paged UI and fetch them in chunks. *) - memory_reference : string option [@key "memoryReference"] [@default None]; (** Optional memory reference for the variable if the variable represents executable code, such as a function pointer. - This attribute is only required if the client has passed the value true for the 'supportsMemoryReferences' capability of the 'initialize' request. *) + The client can use this information to present the children in a paged UI and fetch them in chunks. *) + memory_reference : string option [@key "memoryReference"] [@default None]; (** A memory reference associated with this variable. + For pointer type variables, this is generally a reference to the memory address contained in the pointer. + For executable data, this reference may later be used in a `disassemble` request. + This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true. *) + declaration_location_reference : int option [@key "declarationLocationReference"] [@default None]; (** A reference that allows the client to request the location where the variable is declared. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) + value_location_reference : int option [@key "valueLocationReference"] [@default None]; (** A reference that allows the client to request the location where the variable's value is declared. For example, if the variable contains a function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) __vscode_variable_menu_context : string option [@key "__vscodeVariableMenuContext"] [@default None]; } [@@deriving make, yojson {strict = false}] end module Breakpoint_location : sig - (** Properties of a breakpoint location returned from the 'breakpointLocations' request. *) + (** Properties of a breakpoint location returned from the `breakpointLocations` request. *) type t = { line : int; (** Start line of breakpoint location. *) - column : int option [@default None]; (** Optional start column of breakpoint location. *) - end_line : int option [@key "endLine"] [@default None]; (** Optional end line of breakpoint location if the location covers a range. *) - end_column : int option [@key "endColumn"] [@default None]; (** Optional end column of breakpoint location if the location covers a range. *) + column : int option [@default None]; (** The start position of a breakpoint location. Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of breakpoint location if the location covers a range. *) + end_column : int option [@key "endColumn"] [@default None]; (** The end position of a breakpoint location (if the location covers a range). Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) } [@@deriving make, yojson {strict = false}] end module Source_breakpoint : sig - (** Properties of a breakpoint or logpoint passed to the setBreakpoints request. *) + (** Properties of a breakpoint or logpoint passed to the `setBreakpoints` request. *) type t = { line : int; (** The source line of the breakpoint or logpoint. *) - column : int option [@default None]; (** An optional source column of the breakpoint. *) - condition : string option [@default None]; (** An optional expression for conditional breakpoints. - It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true. *) - hit_condition : string option [@key "hitCondition"] [@default None]; (** An optional expression that controls how many hits of the breakpoint are ignored. - The backend is expected to interpret the expression as needed. - The attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true. *) - log_message : string option [@key "logMessage"] [@default None]; (** If this attribute exists and is non-empty, the backend must not 'break' (stop) - but log the message instead. Expressions within \{\} are interpolated. - The attribute is only honored by a debug adapter if the capability 'supportsLogPoints' is true. *) + column : int option [@default None]; (** Start position within source line of the breakpoint or logpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + condition : string option [@default None]; (** The expression for conditional breakpoints. + It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true. *) + hit_condition : string option [@key "hitCondition"] [@default None]; (** The expression that controls how many hits of the breakpoint are ignored. + The debug adapter is expected to interpret the expression as needed. + The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true. + If both this property and `condition` are specified, `hitCondition` should be evaluated only if the `condition` is met, and the debug adapter should stop only if both conditions are met. *) + log_message : string option [@key "logMessage"] [@default None]; (** If this attribute exists and is non-empty, the debug adapter must not 'break' (stop) + but log the message instead. Expressions within `\{\}` are interpolated. + The attribute is only honored by a debug adapter if the corresponding capability `supportsLogPoints` is true. + If either `hitCondition` or `condition` is specified, then the message should only be logged if those conditions are met. *) + mode : string option [@default None]; (** The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. *) } [@@deriving make, yojson {strict = false}] end module Function_breakpoint : sig - (** Properties of a breakpoint passed to the setFunctionBreakpoints request. *) + (** Properties of a breakpoint passed to the `setFunctionBreakpoints` request. *) type t = { name : string; (** The name of the function. *) - condition : string option [@default None]; (** An optional expression for conditional breakpoints. - It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true. *) - hit_condition : string option [@key "hitCondition"] [@default None]; (** An optional expression that controls how many hits of the breakpoint are ignored. - The backend is expected to interpret the expression as needed. - The attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true. *) + condition : string option [@default None]; (** An expression for conditional breakpoints. + It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true. *) + hit_condition : string option [@key "hitCondition"] [@default None]; (** An expression that controls how many hits of the breakpoint are ignored. + The debug adapter is expected to interpret the expression as needed. + The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true. *) } [@@deriving make, yojson {strict = false}] end @@ -509,55 +550,72 @@ module Data_breakpoint_access_type : sig end module Data_breakpoint : sig - (** Properties of a data breakpoint passed to the setDataBreakpoints request. *) + (** Properties of a data breakpoint passed to the `setDataBreakpoints` request. *) type t = { - data_id : string [@key "dataId"]; (** An id representing the data. This id is returned from the dataBreakpointInfo request. *) + data_id : string [@key "dataId"]; (** An id representing the data. This id is returned from the `dataBreakpointInfo` request. *) access_type : Data_breakpoint_access_type.t option [@key "accessType"] [@default None]; (** The access type of the data. *) - condition : string option [@default None]; (** An optional expression for conditional breakpoints. *) - hit_condition : string option [@key "hitCondition"] [@default None]; (** An optional expression that controls how many hits of the breakpoint are ignored. - The backend is expected to interpret the expression as needed. *) + condition : string option [@default None]; (** An expression for conditional breakpoints. *) + hit_condition : string option [@key "hitCondition"] [@default None]; (** An expression that controls how many hits of the breakpoint are ignored. + The debug adapter is expected to interpret the expression as needed. *) } [@@deriving make, yojson {strict = false}] end module Instruction_breakpoint : sig - (** Properties of a breakpoint passed to the setInstructionBreakpoints request *) + (** Properties of a breakpoint passed to the `setInstructionBreakpoints` request *) type t = { instruction_reference : string [@key "instructionReference"]; (** The instruction reference of the breakpoint. - This should be a memory or instruction pointer reference from an EvaluateResponse, Variable, StackFrame, GotoTarget, or Breakpoint. *) - offset : int option [@default None]; (** An optional offset from the instruction reference. + This should be a memory or instruction pointer reference from an `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or `Breakpoint`. *) + offset : int option [@default None]; (** The offset from the instruction reference in bytes. This can be negative. *) - condition : string option [@default None]; (** An optional expression for conditional breakpoints. - It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true. *) - hit_condition : string option [@key "hitCondition"] [@default None]; (** An optional expression that controls how many hits of the breakpoint are ignored. - The backend is expected to interpret the expression as needed. - The attribute is only honored by a debug adapter if the capability 'supportsHitConditionalBreakpoints' is true. *) + condition : string option [@default None]; (** An expression for conditional breakpoints. + It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true. *) + hit_condition : string option [@key "hitCondition"] [@default None]; (** An expression that controls how many hits of the breakpoint are ignored. + The debug adapter is expected to interpret the expression as needed. + The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true. *) + mode : string option [@default None]; (** The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. *) } [@@deriving make, yojson {strict = false}] end module Breakpoint : sig - (** Information about a Breakpoint created in setBreakpoints, setFunctionBreakpoints, setInstructionBreakpoints, or setDataBreakpoints. *) + module Reason : sig + (** A machine-readable explanation of why a breakpoint may not be verified. If a breakpoint is verified or a specific reason is not known, the adapter should omit this property. Possible values include: + + - `pending`: Indicates a breakpoint might be verified in the future, but the adapter cannot verify it in the current state. + - `failed`: Indicates a breakpoint was not able to be verified, and the adapter does not believe it can be verified without intervention. *) + type t = + | Pending [@name "pending"] + | Failed [@name "failed"] + + include JSONABLE with type t := t + end + + (** Information about a breakpoint created in `setBreakpoints`, `setFunctionBreakpoints`, `setInstructionBreakpoints`, or `setDataBreakpoints` requests. *) type t = { - id : int option [@default None]; (** An optional identifier for the breakpoint. It is needed if breakpoint events are used to update or remove breakpoints. *) - verified : bool; (** If true breakpoint could be set (but not necessarily at the desired location). *) - message : string option [@default None]; (** An optional message about the state of the breakpoint. + id : int option [@default None]; (** The identifier for the breakpoint. It is needed if breakpoint events are used to update or remove breakpoints. *) + verified : bool; (** If true, the breakpoint could be set (but not necessarily at the desired location). *) + message : string option [@default None]; (** A message about the state of the breakpoint. This is shown to the user and can be used to explain why a breakpoint could not be verified. *) source : Source.t option [@default None]; (** The source where the breakpoint is located. *) line : int option [@default None]; (** The start line of the actual range covered by the breakpoint. *) - column : int option [@default None]; (** An optional start column of the actual range covered by the breakpoint. *) - end_line : int option [@key "endLine"] [@default None]; (** An optional end line of the actual range covered by the breakpoint. *) - end_column : int option [@key "endColumn"] [@default None]; (** An optional end column of the actual range covered by the breakpoint. + column : int option [@default None]; (** Start position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the actual range covered by the breakpoint. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no end line is given, then the end column is assumed to be in the start line. *) - instruction_reference : string option [@key "instructionReference"] [@default None]; (** An optional memory reference to where the breakpoint is set. *) - offset : int option [@default None]; (** An optional offset from the instruction reference. + instruction_reference : string option [@key "instructionReference"] [@default None]; (** A memory reference to where the breakpoint is set. *) + offset : int option [@default None]; (** The offset from the instruction reference. This can be negative. *) + reason : Reason.t option [@default None]; (** A machine-readable explanation of why a breakpoint may not be verified. If a breakpoint is verified or a specific reason is not known, the adapter should omit this property. Possible values include: + + - `pending`: Indicates a breakpoint might be verified in the future, but the adapter cannot verify it in the current state. + - `failed`: Indicates a breakpoint was not able to be verified, and the adapter does not believe it can be verified without intervention. *) } [@@deriving make, yojson {strict = false}] end module Stepping_granularity : sig - (** The granularity of one 'step' in the stepping requests 'next', 'stepIn', 'stepOut', and 'stepBack'. *) + (** The granularity of one 'step' in the stepping requests `next`, `stepIn`, `stepOut`, and `stepBack`. *) type t = | Statement [@name "statement"] | Line [@name "line"] @@ -567,25 +625,29 @@ module Stepping_granularity : sig end module Step_in_target : sig - (** A StepInTarget can be used in the 'stepIn' request and determines into which single target the stepIn request should step. *) + (** A `StepInTarget` can be used in the `stepIn` request and determines into which single target the `stepIn` request should step. *) type t = { - id : int; (** Unique identifier for a stepIn target. *) - label : string; (** The name of the stepIn target (shown in the UI). *) + id : int; (** Unique identifier for a step-in target. *) + label : string; (** The name of the step-in target (shown in the UI). *) + line : int option [@default None]; (** The line of the step-in target. *) + column : int option [@default None]; (** Start position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the range covered by the step-in target. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) } [@@deriving make, yojson {strict = false}] end module Goto_target : sig - (** A GotoTarget describes a code location that can be used as a target in the 'goto' request. - The possible goto targets can be determined via the 'gotoTargets' request. *) + (** A `GotoTarget` describes a code location that can be used as a target in the `goto` request. + The possible goto targets can be determined via the `gotoTargets` request. *) type t = { - id : int; (** Unique identifier for a goto target. This is used in the goto request. *) + id : int; (** Unique identifier for a goto target. This is used in the `goto` request. *) label : string; (** The name of the goto target (shown in the UI). *) line : int; (** The line of the goto target. *) - column : int option [@default None]; (** An optional column of the goto target. *) - end_line : int option [@key "endLine"] [@default None]; (** An optional end line of the range covered by the goto target. *) - end_column : int option [@key "endColumn"] [@default None]; (** An optional end column of the range covered by the goto target. *) - instruction_pointer_reference : string option [@key "instructionPointerReference"] [@default None]; (** Optional memory reference for the instruction pointer value represented by this target. *) + column : int option [@default None]; (** The column of the goto target. *) + end_line : int option [@key "endLine"] [@default None]; (** The end line of the range covered by the goto target. *) + end_column : int option [@key "endColumn"] [@default None]; (** The end column of the range covered by the goto target. *) + instruction_pointer_reference : string option [@key "instructionPointerReference"] [@default None]; (** A memory reference for the instruction pointer value represented by this target. *) } [@@deriving make, yojson {strict = false}] end @@ -617,22 +679,17 @@ module Completion_item_type : sig end module Completion_item : sig - (** CompletionItems are the suggestions returned from the CompletionsRequest. *) + (** `CompletionItems` are the suggestions returned from the `completions` request. *) type t = { label : string; (** The label of this completion item. By default this is also the text that is inserted when selecting this completion. *) - text : string option [@default None]; (** If text is not falsy then it is inserted instead of the label. *) - sort_text : string option [@key "sortText"] [@default None]; (** A string that should be used when comparing this item with other items. When `falsy` the label is used. *) + text : string option [@default None]; (** If text is returned and not an empty string, then it is inserted instead of the label. *) + sort_text : string option [@key "sortText"] [@default None]; (** A string that should be used when comparing this item with other items. If not returned or an empty string, the `label` is used instead. *) + detail : string option [@default None]; (** A human-readable string with additional information about this item, like type or symbol information. *) type_ : Completion_item_type.t option [@key "type"] [@default None]; (** The item's type. Typically the client uses this information to render the item in the UI with an icon. *) - start : int option [@default None]; (** This value determines the location (in the CompletionsRequest's 'text' attribute) where the completion text is added. - If missing the text is added at the location specified by the CompletionsRequest's 'column' attribute. *) - length : int option [@default None]; (** This value determines how many characters are overwritten by the completion text. - If missing the value 0 is assumed which results in the completion text being inserted. *) - selection_start : int option [@key "selectionStart"] [@default None]; (** Determines the start of the new selection after the text has been inserted (or replaced). - The start position must in the range 0 and length of the completion text. - If omitted the selection starts at the end of the completion text. *) - selection_length : int option [@key "selectionLength"] [@default None]; (** Determines the length of the new selection after the text has been inserted (or replaced). - The selection can not extend beyond the bounds of the completion text. - If omitted the length is assumed to be 0. *) + start : int option [@default None]; (** Start position (within the `text` attribute of the `completions` request) where the completion text is added. The position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If the start position is omitted the text is added at the location specified by the `column` attribute of the `completions` request. *) + length : int option [@default None]; (** Length determines how many characters are overwritten by the completion text and it is measured in UTF-16 code units. If missing the value 0 is assumed which results in the completion text being inserted. *) + selection_start : int option [@key "selectionStart"] [@default None]; (** Determines the start of the new selection after the text has been inserted (or replaced). `selectionStart` is measured in UTF-16 code units and must be in the range 0 and length of the completion text. If omitted the selection starts at the end of the completion text. *) + selection_length : int option [@key "selectionLength"] [@default None]; (** Determines the length of the new selection after the text has been inserted (or replaced) and it is measured in UTF-16 code units. The selection can not extend beyond the bounds of the completion text. If omitted the length is assumed to be 0. *) } [@@deriving make, yojson {strict = false}] end @@ -660,22 +717,22 @@ module Stack_frame_format : sig end module Exception_filter_options : sig - (** An ExceptionFilterOptions is used to specify an exception filter together with a condition for the setExceptionsFilter request. *) + (** An `ExceptionFilterOptions` is used to specify an exception filter together with a condition for the `setExceptionBreakpoints` request. *) type t = { - filter_id : string [@key "filterId"]; (** ID of an exception filter returned by the 'exceptionBreakpointFilters' capability. *) - condition : string option [@default None]; (** An optional expression for conditional exceptions. - The exception will break into the debugger if the result of the condition is true. *) + filter_id : string [@key "filterId"]; (** ID of an exception filter returned by the `exceptionBreakpointFilters` capability. *) + condition : string option [@default None]; (** An expression for conditional exceptions. + The exception breaks into the debugger if the result of the condition is true. *) + mode : string option [@default None]; (** The mode of this exception breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. *) } [@@deriving make, yojson {strict = false}] end module Exception_path_segment : sig - (** An ExceptionPathSegment represents a segment in a path that is used to match leafs or nodes in a tree of exceptions. - If a segment consists of more than one name, it matches the names provided if 'negate' is false or missing or - it matches anything except the names provided if 'negate' is true. *) + (** An `ExceptionPathSegment` represents a segment in a path that is used to match leafs or nodes in a tree of exceptions. + If a segment consists of more than one name, it matches the names provided if `negate` is false or missing, or it matches anything except the names provided if `negate` is true. *) type t = { negate : bool option [@default None]; (** If false or missing this segment matches the names provided, otherwise it matches anything except the names provided. *) - names : string list; (** Depending on the value of 'negate' the names that should match or not match. *) + names : string list; (** Depending on the value of `negate` the names that should match or not match. *) } [@@deriving make, yojson {strict = false}] end @@ -696,9 +753,9 @@ module Exception_break_mode : sig end module Exception_options : sig - (** An ExceptionOptions assigns configuration options to a set of exceptions. *) + (** An `ExceptionOptions` assigns configuration options to a set of exceptions. *) type t = { - path : Exception_path_segment.t list option [@default None]; (** A path that selects a single or multiple exceptions in a tree. If 'path' is missing, the whole tree is selected. + path : Exception_path_segment.t list option [@default None]; (** A path that selects a single or multiple exceptions in a tree. If `path` is missing, the whole tree is selected. By convention the first segment of the path is a category that is used to group exceptions in the UI. *) break_mode : Exception_break_mode.t [@key "breakMode"]; (** Condition when a thrown exception should result in a break. *) } @@ -711,7 +768,7 @@ module Exception_details : sig message : string option [@default None]; (** Message contained in the exception. *) type_name : string option [@key "typeName"] [@default None]; (** Short type name of the exception object. *) full_type_name : string option [@key "fullTypeName"] [@default None]; (** Fully-qualified type name of the exception object. *) - evaluate_name : string option [@key "evaluateName"] [@default None]; (** Optional expression that can be evaluated in the current scope to obtain the exception object. *) + evaluate_name : string option [@key "evaluateName"] [@default None]; (** An expression that can be evaluated in the current scope to obtain the exception object. *) stack_trace : string option [@key "stackTrace"] [@default None]; (** Stack trace at the time the exception was thrown. *) inner_exception : t list option [@key "innerException"] [@default None]; (** Details of the exception contained by this exception, if any. *) } @@ -719,10 +776,21 @@ module Exception_details : sig end module Disassembled_instruction : sig + module Presentation_hint : sig + (** A hint for how to present the instruction in the UI. + + A value of `invalid` may be used to indicate this instruction is 'filler' and cannot be reached by the program. For example, unreadable memory addresses may be presented is 'invalid.' *) + type t = + | Normal [@name "normal"] + | Invalid [@name "invalid"] + + include JSONABLE with type t := t + end + (** Represents a single disassembled instruction. *) type t = { - address : string; (** The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. *) - instruction_bytes : string option [@key "instructionBytes"] [@default None]; (** Optional raw bytes representing the instruction and its operands, in an implementation-defined format. *) + address : string; (** The address of the instruction. Treated as a hex value if prefixed with `0x`, or as a decimal value otherwise. *) + instruction_bytes : string option [@key "instructionBytes"] [@default None]; (** Raw bytes representing the instruction and its operands, in an implementation-defined format. *) instruction : string; (** Text representing the instruction and its operands, in an implementation-defined format. *) symbol : string option [@default None]; (** Name of the symbol that corresponds with the location of this instruction, if any. *) location : Source.t option [@default None]; (** Source location that corresponds to this instruction, if any. @@ -732,12 +800,15 @@ module Disassembled_instruction : sig column : int option [@default None]; (** The column within the line that corresponds to this instruction, if any. *) end_line : int option [@key "endLine"] [@default None]; (** The end line of the range that corresponds to this instruction, if any. *) end_column : int option [@key "endColumn"] [@default None]; (** The end column of the range that corresponds to this instruction, if any. *) + presentation_hint : Presentation_hint.t option [@key "presentationHint"] [@default None]; (** A hint for how to present the instruction in the UI. + + A value of `invalid` may be used to indicate this instruction is 'filler' and cannot be reached by the program. For example, unreadable memory addresses may be presented is 'invalid.' *) } [@@deriving make, yojson {strict = false}] end module Invalidated_areas : sig - (** Logical areas that can be invalidated by the 'invalidated' event. *) + (** Logical areas that can be invalidated by the `invalidated` event. *) type t = | All [@name "all"] | Stacks [@name "stacks"] @@ -763,7 +834,7 @@ module Stopped_event : sig module Payload : sig module Reason : sig (** The reason for the event. - For backward compatibility this string is shown in the UI if the 'description' attribute is missing (but it must not be translated). *) + For backward compatibility this string is shown in the UI if the `description` attribute is missing (but it must not be translated). *) type t = | Step [@name "step"] | Breakpoint [@name "breakpoint"] @@ -781,14 +852,18 @@ module Stopped_event : sig type t = { reason : Reason.t; (** The reason for the event. - For backward compatibility this string is shown in the UI if the 'description' attribute is missing (but it must not be translated). *) - description : string option [@default None]; (** The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is and must be translated. *) + For backward compatibility this string is shown in the UI if the `description` attribute is missing (but it must not be translated). *) + description : string option [@default None]; (** The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is and can be translated. *) thread_id : int option [@key "threadId"] [@default None]; (** The thread which was stopped. *) - preserve_focus_hint : bool option [@key "preserveFocusHint"] [@default None]; (** A value of true hints to the frontend that this event should not change the focus. *) - text : string option [@default None]; (** Additional information. E.g. if reason is 'exception', text contains the exception name. This string is shown in the UI. *) - all_threads_stopped : bool option [@key "allThreadsStopped"] [@default None]; (** If 'allThreadsStopped' is true, a debug adapter can announce that all threads have stopped. + preserve_focus_hint : bool option [@key "preserveFocusHint"] [@default None]; (** A value of true hints to the client that this event should not change the focus. *) + text : string option [@default None]; (** Additional information. E.g. if reason is `exception`, text contains the exception name. This string is shown in the UI. *) + all_threads_stopped : bool option [@key "allThreadsStopped"] [@default None]; (** If `allThreadsStopped` is true, a debug adapter can announce that all threads have stopped. - The client should use this information to enable that all threads can be expanded to access their stacktraces. - - If the attribute is missing or false, only the thread with the given threadId can be expanded. *) + - If the attribute is missing or false, only the thread with the given `threadId` can be expanded. *) + hit_breakpoint_ids : int list option [@key "hitBreakpointIds"] [@default None]; (** Ids of the breakpoints that triggered the event. In most cases there is only a single breakpoint but here are some examples for multiple breakpoints: + - Different types of breakpoints map to the same location. + - Multiple source breakpoints get collapsed to the same instruction by the compiler/runtime. + - Multiple function breakpoints with different function names map to the same location. *) } [@@deriving make, yojson {strict = false}] end @@ -800,7 +875,7 @@ module Continued_event : sig module Payload : sig type t = { thread_id : int [@key "threadId"]; (** The thread which was continued. *) - all_threads_continued : bool option [@key "allThreadsContinued"] [@default None]; (** If 'allThreadsContinued' is true, a debug adapter can announce that all threads have continued. *) + all_threads_continued : bool option [@key "allThreadsContinued"] [@default None]; (** If `allThreadsContinued` is true, a debug adapter can announce that all threads have continued. *) } [@@deriving make, yojson {strict = false}] end @@ -822,8 +897,8 @@ module Terminated_event : sig module Payload : sig type t = { - restart : Any.t option [@default None]; (** A debug adapter may set 'restart' to true (or to an arbitrary object) to request that the front end restarts the session. - The value is not interpreted by the client and passed unmodified as an attribute '__restart' to the 'launch' and 'attach' requests. *) + restart : Any.t option [@default None]; (** A debug adapter may set `restart` to true (or to an arbitrary object) to request that the client restarts the session. + The value is not interpreted by the client and passed unmodified as an attribute `__restart` to the `launch` and `attach` requests. *) } [@@deriving make, yojson {strict = false}] end @@ -856,9 +931,10 @@ module Output_event : sig module Payload : sig module Category : sig - (** The output category. If not specified, 'console' is assumed. *) + (** The output category. If not specified or if the category is not understood by the client, `console` is assumed. *) type t = | Console [@name "console"] + | Important [@name "important"] | Stdout [@name "stdout"] | Stderr [@name "stderr"] | Telemetry [@name "telemetry"] @@ -878,14 +954,21 @@ module Output_event : sig end type t = { - category : Category.t option [@default None]; (** The output category. If not specified, 'console' is assumed. *) - output : string; (** The output to report. *) + category : Category.t option [@default None]; (** The output category. If not specified or if the category is not understood by the client, `console` is assumed. *) + output : string; (** The output to report. + + ANSI escape sequences may be used to influence text color and styling if `supportsANSIStyling` is present in both the adapter's `Capabilities` and the client's `InitializeRequestArguments`. A client may strip any unrecognized ANSI sequences. + + If the `supportsANSIStyling` capabilities are not both true, then the client should display the output literally. *) group : Group.t option [@default None]; (** Support for keeping an output log organized by grouping related messages. *) - variables_reference : int option [@key "variablesReference"] [@default None]; (** 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 : Source.t option [@default None]; (** An optional source location where the output was produced. *) - line : int option [@default None]; (** An optional source location line where the output was produced. *) - column : int option [@default None]; (** An optional source location column where the output was produced. *) - data : Any.t option [@default None]; (** Optional data to report. For the 'telemetry' category the data will be sent to telemetry, for the other categories the data is shown in JSON format. *) + variables_reference : int option [@key "variablesReference"] [@default None]; (** 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 as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) + source : Source.t option [@default None]; (** The source location where the output was produced. *) + line : int option [@default None]; (** The source location's line where the output was produced. *) + column : int option [@default None]; (** The position in `line` where the output was produced. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + data : Any.t option [@default None]; (** Additional data to report. For the `telemetry` category the data is sent to telemetry, for the other categories the data is shown in JSON format. *) + location_reference : int option [@key "locationReference"] [@default None]; (** A reference that allows the client to request the location where the new value is declared. For example, if the logged value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end @@ -908,7 +991,7 @@ module Breakpoint_event : sig type t = { reason : Reason.t; (** The reason for the event. *) - breakpoint : Breakpoint.t; (** The 'id' attribute is used to find the target breakpoint and the other attributes are used as the new values. *) + breakpoint : Breakpoint.t; (** The `id` attribute is used to find the target breakpoint, the other attributes are used as the new values. *) } [@@deriving make, yojson {strict = false}] end @@ -930,7 +1013,7 @@ module Module_event : sig type t = { reason : Reason.t; (** The reason for the event. *) - module_ : Module.t [@key "module"]; (** The new, changed, or removed module. In case of 'removed' only the module id is used. *) + module_ : Module.t [@key "module"]; (** The new, changed, or removed module. In case of `removed` only the module id is used. *) } [@@deriving make, yojson {strict = false}] end @@ -974,7 +1057,7 @@ module Process_event : sig type t = { name : string; (** The logical name of the process. This is usually the full path to process's executable file. Example: /home/example/myproj/program.js. *) - system_process_id : int option [@key "systemProcessId"] [@default None]; (** The system process id of the debugged process. This property will be missing for non-system processes. *) + system_process_id : int option [@key "systemProcessId"] [@default None]; (** The process ID of the debugged process, as assigned by the operating system. This property should be omitted for logical processes that do not map to operating system processes on the machine. *) is_local_process : bool option [@key "isLocalProcess"] [@default None]; (** If true, the process is running on the same computer as the debug adapter. *) start_method : Start_method.t option [@key "startMethod"] [@default None]; (** Describes how the debug engine started debugging this process. *) pointer_size : int option [@key "pointerSize"] [@default None]; (** The size of a pointer or address for this process, in bits. This value may be used by clients when formatting addresses for display. *) @@ -999,17 +1082,16 @@ module Progress_start_event : sig module Payload : sig type t = { - progress_id : string [@key "progressId"]; (** An ID that must be used in subsequent 'progressUpdate' and 'progressEnd' events to make them refer to the same progress reporting. + progress_id : string [@key "progressId"]; (** An ID that can be used in subsequent `progressUpdate` and `progressEnd` events to make them refer to the same progress reporting. IDs must be unique within a debug session. *) - title : string; (** Mandatory (short) title of the progress reporting. Shown in the UI to describe the long running operation. *) - request_id : int option [@key "requestId"] [@default None]; (** The request ID that this progress report is related to. If specified a debug adapter is expected to emit - progress events for the long running request until the request has been either completed or cancelled. + title : string; (** Short title of the progress reporting. Shown in the UI to describe the long running operation. *) + request_id : int option [@key "requestId"] [@default None]; (** The request ID that this progress report is related to. If specified a debug adapter is expected to emit progress events for the long running request until the request has been either completed or cancelled. If the request ID is omitted, the progress report is assumed to be related to some general activity of the debug adapter. *) - cancellable : bool option [@default None]; (** If true, the request that reports progress may be canceled with a 'cancel' request. + cancellable : bool option [@default None]; (** If true, the request that reports progress may be cancelled with a `cancel` request. So this property basically controls whether the client should use UX that supports cancellation. Clients that don't support cancellation are allowed to ignore the setting. *) - message : string option [@default None]; (** Optional, more detailed progress message. *) - percentage : float option [@default None]; (** Optional progress percentage to display (value range: 0 to 100). If omitted no percentage will be shown. *) + message : string option [@default None]; (** More detailed progress message. *) + percentage : float option [@default None]; (** Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown. *) } [@@deriving make, yojson {strict = false}] end @@ -1020,9 +1102,9 @@ module Progress_update_event : sig module Payload : sig type t = { - progress_id : string [@key "progressId"]; (** The ID that was introduced in the initial 'progressStart' event. *) - message : string option [@default None]; (** Optional, more detailed progress message. If omitted, the previous message (if any) is used. *) - percentage : float option [@default None]; (** Optional progress percentage to display (value range: 0 to 100). If omitted no percentage will be shown. *) + progress_id : string [@key "progressId"]; (** The ID that was introduced in the initial `progressStart` event. *) + message : string option [@default None]; (** More detailed progress message. If omitted, the previous message (if any) is used. *) + percentage : float option [@default None]; (** Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown. *) } [@@deriving make, yojson {strict = false}] end @@ -1033,8 +1115,8 @@ module Progress_end_event : sig module Payload : sig type t = { - progress_id : string [@key "progressId"]; (** The ID that was introduced in the initial 'ProgressStartEvent'. *) - message : string option [@default None]; (** Optional, more detailed progress message. If omitted, the previous message (if any) is used. *) + progress_id : string [@key "progressId"]; (** The ID that was introduced in the initial `ProgressStartEvent`. *) + message : string option [@default None]; (** More detailed progress message. If omitted, the previous message (if any) is used. *) } [@@deriving make, yojson {strict = false}] end @@ -1045,35 +1127,47 @@ module Invalidated_event : sig module Payload : sig type t = { - areas : Invalidated_areas.t list option [@default None]; (** Optional set of logical areas that got invalidated. This property has a hint characteristic: a client can only be expected to make a 'best effort' in honouring the areas but there are no guarantees. If this property is missing, empty, or if values are not understand the client should assume a single value 'all'. *) + areas : Invalidated_areas.t list option [@default None]; (** Set of logical areas that got invalidated. This property has a hint characteristic: a client can only be expected to make a 'best effort' in honoring the areas but there are no guarantees. If this property is missing, empty, or if values are not understood, the client should assume a single value `all`. *) thread_id : int option [@key "threadId"] [@default None]; (** If specified, the client only needs to refetch data related to this thread. *) - stack_frame_id : int option [@key "stackFrameId"] [@default None]; (** If specified, the client only needs to refetch data related to this stack frame (and the 'threadId' is ignored). *) + stack_frame_id : int option [@key "stackFrameId"] [@default None]; (** If specified, the client only needs to refetch data related to this stack frame (and the `threadId` is ignored). *) + } + [@@deriving make, yojson {strict = false}] + end +end + +module Memory_event : sig + val type_ : string + + module Payload : sig + type t = { + memory_reference : string [@key "memoryReference"]; (** Memory reference of a memory range that has been updated. *) + offset : int; (** Starting offset in bytes where memory has been updated. Can be negative. *) + count : int; (** Number of bytes updated. *) } [@@deriving make, yojson {strict = false}] end end -(** The 'cancel' request is used by the frontend in two situations: +(** The `cancel` request is used by the client in two situations: - to indicate that it is no longer interested in the result produced by a specific request issued earlier -- to cancel a progress sequence. Clients should only call this request if the capability 'supportsCancelRequest' is true. -This request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honouring this request but there are no guarantees. -The 'cancel' request may return an error if it could not cancel an operation but a frontend should refrain from presenting this error to end users. -A frontend client should only call this request if the capability 'supportsCancelRequest' is true. -The request that got canceled still needs to send a response back. This can either be a normal result ('success' attribute true) -or an error response ('success' attribute false and the 'message' set to 'cancelled'). -Returning partial results from a cancelled request is possible but please note that a frontend client has no generic way for detecting that a response is partial or not. - The progress that got cancelled still needs to send a 'progressEnd' event back. - A client should not assume that progress just got cancelled after sending the 'cancel' request. *) +- to cancel a progress sequence. +Clients should only call this request if the corresponding capability `supportsCancelRequest` is true. +This request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees. +The `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users. +The request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`). +Returning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not. +The progress that got cancelled still needs to send a `progressEnd` event back. + A client should not assume that progress just got cancelled after sending the `cancel` request. *) module Cancel_command : sig val type_ : string module Arguments : sig - (** Arguments for 'cancel' request. *) + (** Arguments for `cancel` request. *) type t = { - request_id : int option [@key "requestId"] [@default None]; (** The ID (attribute 'seq') of the request to cancel. If missing no request is cancelled. - Both a 'requestId' and a 'progressId' can be specified in one request. *) - progress_id : string option [@key "progressId"] [@default None]; (** The ID (attribute 'progressId') of the progress to cancel. If missing no progress is cancelled. - Both a 'requestId' and a 'progressId' can be specified in one request. *) + request_id : int option [@key "requestId"] [@default None]; (** The ID (attribute `seq`) of the request to cancel. If missing no request is cancelled. + Both a `requestId` and a `progressId` can be specified in one request. *) + progress_id : string option [@key "progressId"] [@default None]; (** The ID (attribute `progressId`) of the progress to cancel. If missing no progress is cancelled. + Both a `requestId` and a `progressId` can be specified in one request. *) } [@@deriving make, yojson {strict = false}] end @@ -1084,15 +1178,17 @@ module Cancel_command : sig end end -(** This optional request is sent from the debug adapter to the client to run a command in a terminal. +(** This request is sent from the debug adapter to the client to run a command in a terminal. This is typically used to launch the debuggee in a terminal provided by the client. -This request should only be called if the client has passed the value true for the 'supportsRunInTerminalRequest' capability of the 'initialize' request. *) +This request should only be called if the corresponding client capability `supportsRunInTerminalRequest` is true. +Client implementations of `runInTerminal` are free to run the command however they choose including issuing the command to a command line interpreter (aka 'shell'). Argument strings passed to the `runInTerminal` request must arrive verbatim in the command to be run. As a consequence, clients which use a shell are responsible for escaping any special shell characters in the argument strings to prevent them from being interpreted (and modified) by the shell. +Some users may wish to take advantage of shell processing in the argument strings. For clients which implement `runInTerminal` using an intermediary shell, the `argsCanBeInterpretedByShell` property can be set to true. In this case the client is requested not to escape any special shell characters in the argument strings. *) module Run_in_terminal_command : sig val type_ : string module Arguments : sig module Kind : sig - (** What kind of terminal to launch. *) + (** What kind of terminal to launch. Defaults to `integrated` if not specified. *) type t = | Integrated [@name "integrated"] | External [@name "external"] @@ -1106,13 +1202,14 @@ module Run_in_terminal_command : sig [@@deriving yojson] end - (** Arguments for 'runInTerminal' request. *) + (** Arguments for `runInTerminal` request. *) type t = { - kind : Kind.t option [@default None]; (** What kind of terminal to launch. *) - title : string option [@default None]; (** Optional title of the terminal. *) + kind : Kind.t option [@default None]; (** What kind of terminal to launch. Defaults to `integrated` if not specified. *) + title : string option [@default None]; (** Title of the terminal. *) cwd : string; (** Working directory for the command. For non-empty, valid paths this typically results in execution of a change directory command. *) args : string list; (** List of arguments. The first argument is the command to run. *) env : Env.t option [@default None]; (** Environment key-value pairs that are added to or removed from the default environment. *) + args_can_be_interpreted_by_shell : bool option [@key "argsCanBeInterpretedByShell"] [@default None]; (** This property should only be set if the corresponding capability `supportsArgsCanBeInterpretedByShell` is true. If the client uses an intermediary shell to launch the application, then the client must not attempt to escape characters with special meanings for the shell. The user is fully responsible for escaping as needed and that arguments using special characters may not be portable across shells. *) } [@@deriving make, yojson {strict = false}] end @@ -1126,17 +1223,52 @@ module Run_in_terminal_command : sig end end -(** The 'initialize' request is sent as the first request from the client to the debug adapter -in order to configure it with client capabilities and to retrieve capabilities from the debug adapter. -Until the debug adapter has responded to with an 'initialize' response, the client must not send any additional requests or events to the debug adapter. -In addition the debug adapter is not allowed to send any requests or events to the client until it has responded with an 'initialize' response. -The 'initialize' request may only be sent once. *) +(** This request is sent from the debug adapter to the client to start a new debug session of the same type as the caller. +This request should only be sent if the corresponding client capability `supportsStartDebuggingRequest` is true. +A client implementation of `startDebugging` should start a new debug session (of the same type as the caller) in the same way that the caller's session was started. If the client supports hierarchical debug sessions, the newly created session can be treated as a child of the caller session. *) +module Start_debugging_command : sig + val type_ : string + + module Arguments : sig + module Configuration : sig + (** Arguments passed to the new debug session. The arguments must only contain properties understood by the `launch` or `attach` requests of the debug adapter and they must not contain any client-specific properties (e.g. `type`) or client-specific features (e.g. substitutable 'variables'). *) + type t = Yojson.Safe.t + [@@deriving yojson] + end + + module Request : sig + (** Indicates whether the new debug session should be started with a `launch` or `attach` request. *) + type t = + | Launch [@name "launch"] + | Attach [@name "attach"] + + include JSONABLE with type t := t + end + + (** Arguments for `startDebugging` request. *) + type t = { + configuration : Configuration.t; (** Arguments passed to the new debug session. The arguments must only contain properties understood by the `launch` or `attach` requests of the debug adapter and they must not contain any client-specific properties (e.g. `type`) or client-specific features (e.g. substitutable 'variables'). *) + request : Request.t; (** Indicates whether the new debug session should be started with a `launch` or `attach` request. *) + } + [@@deriving make, yojson {strict = false}] + end + + module Result : sig + type t = Empty_dict.t + [@@deriving yojson] + end +end + +(** The `initialize` request is sent as the first request from the client to the debug adapter in order to configure it with client capabilities and to retrieve capabilities from the debug adapter. +Until the debug adapter has responded with an `initialize` response, the client must not send any additional requests or events to the debug adapter. +In addition the debug adapter is not allowed to send any requests or events to the client until it has responded with an `initialize` response. +The `initialize` request may only be sent once. *) module Initialize_command : sig val type_ : string module Arguments : sig module Path_format : sig - (** Determines in what format paths are specified. The default is 'path', which is the native format. *) + (** Determines in what format paths are specified. The default is `path`, which is the native format. *) type t = | Path [@name "path"] | Uri [@name "uri"] @@ -1145,21 +1277,25 @@ module Initialize_command : sig include JSONABLE with type t := t end - (** Arguments for 'initialize' request. *) + (** Arguments for `initialize` request. *) type t = { - client_id : string option [@key "clientID"] [@default None]; (** The ID of the (frontend) client using this adapter. *) - client_name : string option [@key "clientName"] [@default None]; (** The human readable name of the (frontend) client using this adapter. *) + client_id : string option [@key "clientID"] [@default None]; (** The ID of the client using this adapter. *) + client_name : string option [@key "clientName"] [@default None]; (** The human-readable name of the client using this adapter. *) adapter_id : string [@key "adapterID"]; (** The ID of the debug adapter. *) - locale : string option [@default None]; (** The ISO-639 locale of the (frontend) client using this adapter, e.g. en-US or de-CH. *) + locale : string option [@default None]; (** The ISO-639 locale of the client using this adapter, e.g. en-US or de-CH. *) lines_start_at1 : bool option [@key "linesStartAt1"] [@default None]; (** If true all line numbers are 1-based (default). *) columns_start_at1 : bool option [@key "columnsStartAt1"] [@default None]; (** If true all column numbers are 1-based (default). *) - path_format : Path_format.t option [@key "pathFormat"] [@default None]; (** Determines in what format paths are specified. The default is 'path', which is the native format. *) - supports_variable_type : bool option [@key "supportsVariableType"] [@default None]; (** Client supports the optional type attribute for variables. *) + path_format : Path_format.t option [@key "pathFormat"] [@default None]; (** Determines in what format paths are specified. The default is `path`, which is the native format. *) + supports_variable_type : bool option [@key "supportsVariableType"] [@default None]; (** Client supports the `type` attribute for variables. *) supports_variable_paging : bool option [@key "supportsVariablePaging"] [@default None]; (** Client supports the paging of variables. *) - supports_run_in_terminal_request : bool option [@key "supportsRunInTerminalRequest"] [@default None]; (** Client supports the runInTerminal request. *) + supports_run_in_terminal_request : bool option [@key "supportsRunInTerminalRequest"] [@default None]; (** Client supports the `runInTerminal` request. *) supports_memory_references : bool option [@key "supportsMemoryReferences"] [@default None]; (** Client supports memory references. *) supports_progress_reporting : bool option [@key "supportsProgressReporting"] [@default None]; (** Client supports progress reporting. *) - supports_invalidated_event : bool option [@key "supportsInvalidatedEvent"] [@default None]; (** Client supports the invalidated event. *) + supports_invalidated_event : bool option [@key "supportsInvalidatedEvent"] [@default None]; (** Client supports the `invalidated` event. *) + supports_memory_event : bool option [@key "supportsMemoryEvent"] [@default None]; (** Client supports the `memory` event. *) + supports_args_can_be_interpreted_by_shell : bool option [@key "supportsArgsCanBeInterpretedByShell"] [@default None]; (** Client supports the `argsCanBeInterpretedByShell` attribute on the `runInTerminal` request. *) + supports_start_debugging_request : bool option [@key "supportsStartDebuggingRequest"] [@default None]; (** Client supports the `startDebugging` request. *) + supports_ansistyling : bool option [@key "supportsANSIStyling"] [@default None]; (** The client will interpret ANSI escape sequences in the display of `OutputEvent.output` and `Variable.value` fields when `Capabilities.supportsANSIStyling` is also enabled. *) } [@@deriving make, yojson {strict = false}] end @@ -1170,14 +1306,14 @@ module Initialize_command : sig end end -(** This optional request indicates that the client has finished initialization of the debug adapter. -So it is the last request in the sequence of configuration requests (which was started by the 'initialized' event). -Clients should only call this request if the capability 'supportsConfigurationDoneRequest' is true. *) +(** This request indicates that the client has finished initialization of the debug adapter. +So it is the last request in the sequence of configuration requests (which was started by the `initialized` event). +Clients should only call this request if the corresponding capability `supportsConfigurationDoneRequest` is true. *) module Configuration_done_command : sig val type_ : string module Arguments : sig - (** Arguments for 'configurationDone' request. *) + (** Arguments for `configurationDone` request. *) type t = Empty_dict.t [@@deriving yojson] end @@ -1188,17 +1324,17 @@ module Configuration_done_command : sig end end -(** This launch request is sent from the client to the debug adapter to start the debuggee with or without debugging (if 'noDebug' is true). +(** This launch request is sent from the client to the debug adapter to start the debuggee with or without debugging (if `noDebug` is true). Since launching is debugger/runtime specific, the arguments for this request are not part of this specification. *) module Launch_command : sig val type_ : string module Arguments : sig - (** Arguments for 'launch' request. Additional attributes are implementation specific. *) + (** Arguments for `launch` request. Additional attributes are implementation specific. *) type t = { - no_debug : bool option [@key "noDebug"] [@default None]; (** If noDebug is true the launch request should launch the program without enabling debugging. *) - __restart : Any.t option [@default None]; (** Optional data from the previous, restarted session. - The data is sent as the 'restart' attribute of the 'terminated' event. + no_debug : bool option [@key "noDebug"] [@default None]; (** If true, the launch request should launch the program without enabling debugging. *) + __restart : Any.t option [@default None]; (** Arbitrary data from the previous, restarted session. + The data is sent as the `restart` attribute of the `terminated` event. The client should leave the data intact. *) } [@@deriving make, yojson {strict = false}] @@ -1210,16 +1346,16 @@ module Launch_command : sig end end -(** The attach request is sent from the client to the debug adapter to attach to a debuggee that is already running. +(** The `attach` request is sent from the client to the debug adapter to attach to a debuggee that is already running. Since attaching is debugger/runtime specific, the arguments for this request are not part of this specification. *) module Attach_command : sig val type_ : string module Arguments : sig - (** Arguments for 'attach' request. Additional attributes are implementation specific. *) + (** Arguments for `attach` request. Additional attributes are implementation specific. *) type t = { - __restart : Any.t option [@default None]; (** Optional data from the previous, restarted session. - The data is sent as the 'restart' attribute of the 'terminated' event. + __restart : Any.t option [@default None]; (** Arbitrary data from the previous, restarted session. + The data is sent as the `restart` attribute of the `terminated` event. The client should leave the data intact. *) } [@@deriving make, yojson {strict = false}] @@ -1231,13 +1367,12 @@ module Attach_command : sig end end -(** Restarts a debug session. Clients should only call this request if the capability 'supportsRestartRequest' is true. -If the capability is missing or has the value false, a typical client will emulate 'restart' by terminating the debug adapter first and then launching it anew. *) +(** Restarts a debug session. Clients should only call this request if the corresponding capability `supportsRestartRequest` is true. +If the capability is missing or has the value false, a typical client emulates `restart` by terminating the debug adapter first and then launching it anew. *) module Restart_command : sig val type_ : string module Arguments : sig - (** Arguments for 'restart' request. *) type t = Empty_dict.t [@@deriving yojson] end @@ -1248,21 +1383,22 @@ module Restart_command : sig end end -(** The 'disconnect' request is sent from the client to the debug adapter in order to stop debugging. -It asks the debug adapter to disconnect from the debuggee and to terminate the debug adapter. -If the debuggee has been started with the 'launch' request, the 'disconnect' request terminates the debuggee. -If the 'attach' request was used to connect to the debuggee, 'disconnect' does not terminate the debuggee. -This behavior can be controlled with the 'terminateDebuggee' argument (if supported by the debug adapter). *) +(** The `disconnect` request asks the debug adapter to disconnect from the debuggee (thus ending the debug session) and then to shut down itself (the debug adapter). +In addition, the debug adapter must terminate the debuggee if it was started with the `launch` request. If an `attach` request was used to connect to the debuggee, then the debug adapter must not terminate the debuggee. +This implicit behavior of when to terminate the debuggee can be overridden with the `terminateDebuggee` argument (which is only supported by a debug adapter if the corresponding capability `supportTerminateDebuggee` is true). *) module Disconnect_command : sig val type_ : string module Arguments : sig - (** Arguments for 'disconnect' request. *) + (** Arguments for `disconnect` request. *) type t = { - restart : bool option [@default None]; (** A value of true indicates that this 'disconnect' request is part of a restart sequence. *) + restart : bool option [@default None]; (** A value of true indicates that this `disconnect` request is part of a restart sequence. *) terminate_debuggee : bool option [@key "terminateDebuggee"] [@default None]; (** Indicates whether the debuggee should be terminated when the debugger is disconnected. If unspecified, the debug adapter is free to do whatever it thinks is best. - The attribute is only honored by a debug adapter if the capability 'supportTerminateDebuggee' is true. *) + The attribute is only honored by a debug adapter if the corresponding capability `supportTerminateDebuggee` is true. *) + suspend_debuggee : bool option [@key "suspendDebuggee"] [@default None]; (** Indicates whether the debuggee should stay suspended when the debugger is disconnected. + If unspecified, the debuggee should resume execution. + The attribute is only honored by a debug adapter if the corresponding capability `supportSuspendDebuggee` is true. *) } [@@deriving make, yojson {strict = false}] end @@ -1273,15 +1409,17 @@ module Disconnect_command : sig end end -(** The 'terminate' request is sent from the client to the debug adapter in order to give the debuggee a chance for terminating itself. -Clients should only call this request if the capability 'supportsTerminateRequest' is true. *) +(** The `terminate` request is sent from the client to the debug adapter in order to shut down the debuggee gracefully. Clients should only call this request if the capability `supportsTerminateRequest` is true. +Typically a debug adapter implements `terminate` by sending a software signal which the debuggee intercepts in order to clean things up properly before terminating itself. +Please note that this request does not directly affect the state of the debug session: if the debuggee decides to veto the graceful shutdown for any reason by not terminating itself, then the debug session just continues. +Clients can surface the `terminate` request as an explicit command or they can integrate it into a two stage Stop command that first sends `terminate` to request a graceful shutdown, and if that fails uses `disconnect` for a forceful shutdown. *) module Terminate_command : sig val type_ : string module Arguments : sig - (** Arguments for 'terminate' request. *) + (** Arguments for `terminate` request. *) type t = { - restart : bool option [@default None]; (** A value of true indicates that this 'terminate' request is part of a restart sequence. *) + restart : bool option [@default None]; (** A value of true indicates that this `terminate` request is part of a restart sequence. *) } [@@deriving make, yojson {strict = false}] end @@ -1292,19 +1430,19 @@ module Terminate_command : sig end end -(** The 'breakpointLocations' request returns all possible locations for source breakpoints in a given range. -Clients should only call this request if the capability 'supportsBreakpointLocationsRequest' is true. *) +(** The `breakpointLocations` request returns all possible locations for source breakpoints in a given range. +Clients should only call this request if the corresponding capability `supportsBreakpointLocationsRequest` is true. *) module Breakpoint_locations_command : sig val type_ : string module Arguments : sig - (** Arguments for 'breakpointLocations' request. *) + (** Arguments for `breakpointLocations` request. *) type t = { - source : Source.t; (** The source location of the breakpoints; either 'source.path' or 'source.reference' must be specified. *) + source : Source.t; (** The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified. *) line : int; (** Start line of range to search possible breakpoint locations in. If only the line is specified, the request returns all possible locations in that line. *) - column : int option [@default None]; (** Optional start column of range to search possible breakpoint locations in. If no start column is given, the first column in the start line is assumed. *) - end_line : int option [@key "endLine"] [@default None]; (** Optional end line of range to search possible breakpoint locations in. If no end line is given, then the end line is assumed to be the start line. *) - end_column : int option [@key "endColumn"] [@default None]; (** Optional end column of range to search possible breakpoint locations in. If no end column is given, then it is assumed to be in the last column of the end line. *) + column : int option [@default None]; (** Start position within `line` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed. *) + end_line : int option [@key "endLine"] [@default None]; (** End line of range to search possible breakpoint locations in. If no end line is given, then the end line is assumed to be the start line. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position within `endLine` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no end column is given, the last position in the end line is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1319,14 +1457,14 @@ end (** Sets multiple breakpoints for a single source and clears all previous breakpoints in that source. To clear all breakpoint for a source, specify an empty array. -When a breakpoint is hit, a 'stopped' event (with reason 'breakpoint') is generated. *) +When a breakpoint is hit, a `stopped` event (with reason `breakpoint`) is generated. *) module Set_breakpoints_command : sig val type_ : string module Arguments : sig - (** Arguments for 'setBreakpoints' request. *) + (** Arguments for `setBreakpoints` request. *) type t = { - source : Source.t; (** The source location of the breakpoints; either 'source.path' or 'source.reference' must be specified. *) + source : Source.t; (** The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified. *) breakpoints : Source_breakpoint.t list option [@default None]; (** The code locations of the breakpoints. *) lines : int list option [@default None]; (** Deprecated: The code locations of the breakpoints. *) source_modified : bool option [@key "sourceModified"] [@default None]; (** A value of true indicates that the underlying source has been modified which results in new breakpoint locations. *) @@ -1337,7 +1475,7 @@ module Set_breakpoints_command : sig module Result : sig type t = { breakpoints : Breakpoint.t list; (** Information about the breakpoints. - The array elements are in the same order as the elements of the 'breakpoints' (or the deprecated 'lines') array in the arguments. *) + The array elements are in the same order as the elements of the `breakpoints` (or the deprecated `lines`) array in the arguments. *) } [@@deriving make, yojson {strict = false}] end @@ -1345,13 +1483,13 @@ end (** Replaces all existing function breakpoints with new function breakpoints. To clear all function breakpoints, specify an empty array. -When a function breakpoint is hit, a 'stopped' event (with reason 'function breakpoint') is generated. -Clients should only call this request if the capability 'supportsFunctionBreakpoints' is true. *) +When a function breakpoint is hit, a `stopped` event (with reason `function breakpoint`) is generated. +Clients should only call this request if the corresponding capability `supportsFunctionBreakpoints` is true. *) module Set_function_breakpoints_command : sig val type_ : string module Arguments : sig - (** Arguments for 'setFunctionBreakpoints' request. *) + (** Arguments for `setFunctionBreakpoints` request. *) type t = { breakpoints : Function_breakpoint.t list; (** The function names of the breakpoints. *) } @@ -1360,56 +1498,67 @@ module Set_function_breakpoints_command : sig module Result : sig type t = { - breakpoints : Breakpoint.t list; (** Information about the breakpoints. The array elements correspond to the elements of the 'breakpoints' array. *) + breakpoints : Breakpoint.t list; (** Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array. *) } [@@deriving make, yojson {strict = false}] end end -(** The request configures the debuggers response to thrown exceptions. -If an exception is configured to break, a 'stopped' event is fired (with reason 'exception'). -Clients should only call this request if the capability 'exceptionBreakpointFilters' returns one or more filters. *) +(** The request configures the debugger's response to thrown exceptions. Each of the `filters`, `filterOptions`, and `exceptionOptions` in the request are independent configurations to a debug adapter indicating a kind of exception to catch. An exception thrown in a program should result in a `stopped` event from the debug adapter (with reason `exception`) if any of the configured filters match. +Clients should only call this request if the corresponding capability `exceptionBreakpointFilters` returns one or more filters. *) module Set_exception_breakpoints_command : sig val type_ : string module Arguments : sig - (** Arguments for 'setExceptionBreakpoints' request. *) + (** Arguments for `setExceptionBreakpoints` request. *) type t = { - filters : string list; (** Set of exception filters specified by their ID. The set of all possible exception filters is defined by the 'exceptionBreakpointFilters' capability. The 'filter' and 'filterOptions' sets are additive. *) - filter_options : Exception_filter_options.t list option [@key "filterOptions"] [@default None]; (** 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. The 'filter' and 'filterOptions' sets are additive. *) + filters : string list; (** Set of exception filters specified by their ID. The set of all possible exception filters is defined by the `exceptionBreakpointFilters` capability. The `filter` and `filterOptions` sets are additive. *) + filter_options : Exception_filter_options.t list option [@key "filterOptions"] [@default None]; (** 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 corresponding capability `supportsExceptionFilterOptions` is true. The `filter` and `filterOptions` sets are additive. *) exception_options : Exception_options.t list option [@key "exceptionOptions"] [@default None]; (** Configuration options for selected exceptions. - The attribute is only honored by a debug adapter if the capability 'supportsExceptionOptions' is true. *) + The attribute is only honored by a debug adapter if the corresponding capability `supportsExceptionOptions` is true. *) } [@@deriving make, yojson {strict = false}] end module Result : sig - type t = Empty_dict.t - [@@deriving yojson] + type t = { + breakpoints : Breakpoint.t list option [@default None]; (** Information about the exception breakpoints or filters. + The breakpoints returned are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays in the arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information. *) + } + [@@deriving make, yojson {strict = false}] end end (** Obtains information on a possible data breakpoint that could be set on an expression or variable. -Clients should only call this request if the capability 'supportsDataBreakpoints' is true. *) +Clients should only call this request if the corresponding capability `supportsDataBreakpoints` is true. *) module Data_breakpoint_info_command : sig val type_ : string module Arguments : sig - (** Arguments for 'dataBreakpointInfo' request. *) + (** Arguments for `dataBreakpointInfo` request. *) type t = { - variables_reference : int option [@key "variablesReference"] [@default None]; (** Reference to the Variable container if the data breakpoint is requested for a child of the container. *) - name : string; (** The name of the Variable's child to obtain data breakpoint information for. - If variablesReference isn’t provided, this can be an expression. *) + variables_reference : int option [@key "variablesReference"] [@default None]; (** Reference to the variable container if the data breakpoint is requested for a child of the container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) + name : string; (** The name of the variable's child to obtain data breakpoint information for. + If `variablesReference` isn't specified, this can be an expression, or an address if `asAddress` is also true. *) + frame_id : int option [@key "frameId"] [@default None]; (** When `name` is an expression, evaluate it in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. When `variablesReference` is specified, this property has no effect. *) + bytes : int option [@default None]; (** If specified, a debug adapter should return information for the range of memory extending `bytes` number of bytes from the address or variable specified by `name`. Breakpoints set using the resulting data ID should pause on data access anywhere within that range. + + Clients may set this property only if the `supportsDataBreakpointBytes` capability is true. *) + as_address : bool option [@key "asAddress"] [@default None]; (** If `true`, the `name` is a memory address and the debugger should interpret it as a decimal value, or hex value if it is prefixed with `0x`. + + Clients may set this property only if the `supportsDataBreakpointBytes` + capability is true. *) + mode : string option [@default None]; (** The mode of the desired breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. *) } [@@deriving make, yojson {strict = false}] end module Result : sig type t = { - data_id : string option [@key "dataId"]; (** An identifier for the data on which a data breakpoint can be registered with the setDataBreakpoints request or null if no data breakpoint is available. *) + data_id : string option [@key "dataId"]; (** An identifier for the data on which a data breakpoint can be registered with the `setDataBreakpoints` request or null if no data breakpoint is available. If a `variablesReference` or `frameId` is passed, the `dataId` is valid in the current suspended state, otherwise it's valid indefinitely. See 'Lifetime of Object References' in the Overview section for details. Breakpoints set using the `dataId` in the `setDataBreakpoints` request may outlive the lifetime of the associated `dataId`. *) description : string; (** UI string that describes on what data the breakpoint is set on or why a data breakpoint is not available. *) - access_types : Data_breakpoint_access_type.t list option [@key "accessTypes"] [@default None]; (** Optional attribute listing the available access types for a potential data breakpoint. A UI frontend could surface this information. *) - can_persist : bool option [@key "canPersist"] [@default None]; (** Optional attribute indicating that a potential data breakpoint could be persisted across sessions. *) + access_types : Data_breakpoint_access_type.t list option [@key "accessTypes"] [@default None]; (** Attribute lists the available access types for a potential data breakpoint. A UI client could surface this information. *) + can_persist : bool option [@key "canPersist"] [@default None]; (** Attribute indicates that a potential data breakpoint could be persisted across sessions. *) } [@@deriving make, yojson {strict = false}] end @@ -1417,13 +1566,13 @@ end (** Replaces all existing data breakpoints with new data breakpoints. To clear all data breakpoints, specify an empty array. -When a data breakpoint is hit, a 'stopped' event (with reason 'data breakpoint') is generated. -Clients should only call this request if the capability 'supportsDataBreakpoints' is true. *) +When a data breakpoint is hit, a `stopped` event (with reason `data breakpoint`) is generated. +Clients should only call this request if the corresponding capability `supportsDataBreakpoints` is true. *) module Set_data_breakpoints_command : sig val type_ : string module Arguments : sig - (** Arguments for 'setDataBreakpoints' request. *) + (** Arguments for `setDataBreakpoints` request. *) type t = { breakpoints : Data_breakpoint.t list; (** The contents of this array replaces all existing data breakpoints. An empty array clears all data breakpoints. *) } @@ -1432,21 +1581,21 @@ module Set_data_breakpoints_command : sig module Result : sig type t = { - breakpoints : Breakpoint.t list; (** Information about the data breakpoints. The array elements correspond to the elements of the input argument 'breakpoints' array. *) + breakpoints : Breakpoint.t list; (** Information about the data breakpoints. The array elements correspond to the elements of the input argument `breakpoints` array. *) } [@@deriving make, yojson {strict = false}] end end -(** Replaces all existing instruction breakpoints. Typically, instruction breakpoints would be set from a diassembly window. +(** Replaces all existing instruction breakpoints. Typically, instruction breakpoints would be set from a disassembly window. To clear all instruction breakpoints, specify an empty array. -When an instruction breakpoint is hit, a 'stopped' event (with reason 'instruction breakpoint') is generated. -Clients should only call this request if the capability 'supportsInstructionBreakpoints' is true. *) +When an instruction breakpoint is hit, a `stopped` event (with reason `instruction breakpoint`) is generated. +Clients should only call this request if the corresponding capability `supportsInstructionBreakpoints` is true. *) module Set_instruction_breakpoints_command : sig val type_ : string module Arguments : sig - (** Arguments for 'setInstructionBreakpoints' request *) + (** Arguments for `setInstructionBreakpoints` request *) type t = { breakpoints : Instruction_breakpoint.t list; (** The instruction references of the breakpoints *) } @@ -1455,44 +1604,45 @@ module Set_instruction_breakpoints_command : sig module Result : sig type t = { - breakpoints : Breakpoint.t list; (** Information about the breakpoints. The array elements correspond to the elements of the 'breakpoints' array. *) + breakpoints : Breakpoint.t list; (** Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array. *) } [@@deriving make, yojson {strict = false}] end end -(** The request starts the debuggee to run again. *) +(** The request resumes execution of all threads. If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true resumes only the specified thread. If not all threads were resumed, the `allThreadsContinued` attribute of the response should be set to false. *) module Continue_command : sig val type_ : string module Arguments : sig - (** Arguments for 'continue' request. *) + (** Arguments for `continue` request. *) type t = { - thread_id : int [@key "threadId"]; (** Continue execution for the specified thread (if possible). - If the backend cannot continue on a single thread but will continue on all threads, it should set the 'allThreadsContinued' attribute in the response to true. *) + thread_id : int [@key "threadId"]; (** Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the argument `singleThread` is true, only the thread with this ID is resumed. *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, execution is resumed only for the thread with given `threadId`. *) } [@@deriving make, yojson {strict = false}] end module Result : sig type t = { - all_threads_continued : bool option [@key "allThreadsContinued"] [@default None]; (** If true, the 'continue' request has ignored the specified thread and continued all threads instead. - If this attribute is missing a value of 'true' is assumed for backward compatibility. *) + all_threads_continued : bool option [@key "allThreadsContinued"] [@default None]; (** The value true (or a missing property) signals to the client that all threads have been resumed. The value false indicates that not all threads were resumed. *) } [@@deriving make, yojson {strict = false}] end end -(** The request starts the debuggee to run again for one step. -The debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed. *) +(** The request executes one step (in the given granularity) for the specified thread and allows all other threads to run freely by resuming them. +If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming. +The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed. *) module Next_command : sig val type_ : string module Arguments : sig - (** Arguments for 'next' request. *) + (** Arguments for `next` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'next' for this thread. *) - granularity : Stepping_granularity.t option [@default None]; (** Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed. *) + thread_id : int [@key "threadId"]; (** Specifies the thread for which to resume execution for one step (of the given granularity). *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, all other suspended threads are not resumed. *) + granularity : Stepping_granularity.t option [@default None]; (** Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1503,21 +1653,23 @@ module Next_command : sig end end -(** The request starts the debuggee to step into a function/method if possible. -If it cannot step into a target, 'stepIn' behaves like 'next'. -The debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed. +(** The request resumes the given thread to step into a function/method and allows all other threads to run freely by resuming them. +If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming. +If the request cannot step into a target, `stepIn` behaves like the `next` request. +The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed. If there are multiple function/method calls (or other targets) on the source line, -the optional argument 'targetId' can be used to control into which target the 'stepIn' should occur. -The list of possible targets for a given source line can be retrieved via the 'stepInTargets' request. *) +the argument `targetId` can be used to control into which target the `stepIn` should occur. +The list of possible targets for a given source line can be retrieved via the `stepInTargets` request. *) module Step_in_command : sig val type_ : string module Arguments : sig - (** Arguments for 'stepIn' request. *) + (** Arguments for `stepIn` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'stepIn' for this thread. *) - target_id : int option [@key "targetId"] [@default None]; (** Optional id of the target to step into. *) - granularity : Stepping_granularity.t option [@default None]; (** Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed. *) + thread_id : int [@key "threadId"]; (** Specifies the thread for which to resume execution for one step-into (of the given granularity). *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, all other suspended threads are not resumed. *) + target_id : int option [@key "targetId"] [@default None]; (** Id of the target to step into. *) + granularity : Stepping_granularity.t option [@default None]; (** Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1528,16 +1680,18 @@ module Step_in_command : sig end end -(** The request starts the debuggee to run again for one step. -The debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed. *) +(** The request resumes the given thread to step out (return) from a function/method and allows all other threads to run freely by resuming them. +If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming. +The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed. *) module Step_out_command : sig val type_ : string module Arguments : sig - (** Arguments for 'stepOut' request. *) + (** Arguments for `stepOut` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'stepOut' for this thread. *) - granularity : Stepping_granularity.t option [@default None]; (** Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed. *) + thread_id : int [@key "threadId"]; (** Specifies the thread for which to resume execution for one step-out (of the given granularity). *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, all other suspended threads are not resumed. *) + granularity : Stepping_granularity.t option [@default None]; (** Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1548,17 +1702,19 @@ module Step_out_command : sig end end -(** The request starts the debuggee to run one step backwards. -The debug adapter first sends the response and then a 'stopped' event (with reason 'step') after the step has completed. -Clients should only call this request if the capability 'supportsStepBack' is true. *) +(** The request executes one backward step (in the given granularity) for the specified thread and allows all other threads to run backward freely by resuming them. +If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming. +The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed. +Clients should only call this request if the corresponding capability `supportsStepBack` is true. *) module Step_back_command : sig val type_ : string module Arguments : sig - (** Arguments for 'stepBack' request. *) + (** Arguments for `stepBack` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'stepBack' for this thread. *) - granularity : Stepping_granularity.t option [@default None]; (** Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed. *) + thread_id : int [@key "threadId"]; (** Specifies the thread for which to resume execution for one step backwards (of the given granularity). *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, all other suspended threads are not resumed. *) + granularity : Stepping_granularity.t option [@default None]; (** Stepping granularity to step. If no granularity is specified, a granularity of `statement` is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -1569,15 +1725,16 @@ module Step_back_command : sig end end -(** The request starts the debuggee to run backward. -Clients should only call this request if the capability 'supportsStepBack' is true. *) +(** The request resumes backward execution of all threads. If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true resumes only the specified thread. If not all threads were resumed, the `allThreadsContinued` attribute of the response should be set to false. +Clients should only call this request if the corresponding capability `supportsStepBack` is true. *) module Reverse_continue_command : sig val type_ : string module Arguments : sig - (** Arguments for 'reverseContinue' request. *) + (** Arguments for `reverseContinue` request. *) type t = { - thread_id : int [@key "threadId"]; (** Execute 'reverseContinue' for this thread. *) + thread_id : int [@key "threadId"]; (** Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the `singleThread` argument is true, only the thread with this ID is resumed. *) + single_thread : bool option [@key "singleThread"] [@default None]; (** If this flag is true, backward execution is resumed only for the thread with given `threadId`. *) } [@@deriving make, yojson {strict = false}] end @@ -1588,16 +1745,16 @@ module Reverse_continue_command : sig end end -(** The request restarts execution of the specified stackframe. -The debug adapter first sends the response and then a 'stopped' event (with reason 'restart') after the restart has completed. -Clients should only call this request if the capability 'supportsRestartFrame' is true. *) +(** The request restarts execution of the specified stack frame. +The debug adapter first sends the response and then a `stopped` event (with reason `restart`) after the restart has completed. +Clients should only call this request if the corresponding capability `supportsRestartFrame` is true. *) module Restart_frame_command : sig val type_ : string module Arguments : sig - (** Arguments for 'restartFrame' request. *) + (** Arguments for `restartFrame` request. *) type t = { - frame_id : int [@key "frameId"]; (** Restart this stackframe. *) + frame_id : int [@key "frameId"]; (** Restart the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end @@ -1609,15 +1766,15 @@ module Restart_frame_command : sig end (** The request sets the location where the debuggee will continue to run. -This makes it possible to skip the execution of code or to executed code again. +This makes it possible to skip the execution of code or to execute code again. The code between the current location and the goto target is not executed but skipped. -The debug adapter first sends the response and then a 'stopped' event with reason 'goto'. -Clients should only call this request if the capability 'supportsGotoTargetsRequest' is true (because only then goto targets exist that can be passed as arguments). *) +The debug adapter first sends the response and then a `stopped` event with reason `goto`. +Clients should only call this request if the corresponding capability `supportsGotoTargetsRequest` is true (because only then goto targets exist that can be passed as arguments). *) module Goto_command : sig val type_ : string module Arguments : sig - (** Arguments for 'goto' request. *) + (** Arguments for `goto` request. *) type t = { thread_id : int [@key "threadId"]; (** Set the goto target for this thread. *) target_id : int [@key "targetId"]; (** The location where the debuggee will continue to run. *) @@ -1632,12 +1789,12 @@ module Goto_command : sig end (** The request suspends the debuggee. -The debug adapter first sends the response and then a 'stopped' event (with reason 'pause') after the thread has been paused successfully. *) +The debug adapter first sends the response and then a `stopped` event (with reason `pause`) after the thread has been paused successfully. *) module Pause_command : sig val type_ : string module Arguments : sig - (** Arguments for 'pause' request. *) + (** Arguments for `pause` request. *) type t = { thread_id : int [@key "threadId"]; (** Pause execution for this thread. *) } @@ -1651,60 +1808,60 @@ module Pause_command : sig end (** The request returns a stacktrace from the current execution state of a given thread. -A client can request all stack frames by omitting the startFrame and levels arguments. For performance conscious clients and if the debug adapter's 'supportsDelayedStackTraceLoading' capability is true, stack frames can be retrieved in a piecemeal way with the startFrame and levels arguments. The response of the stackTrace request may contain a totalFrames property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of totalFrames decide how to proceed. In any case a client should be prepared to receive less frames than requested, which is an indication that the end of the stack has been reached. *) +A client can request all stack frames by omitting the startFrame and levels arguments. For performance-conscious clients and if the corresponding capability `supportsDelayedStackTraceLoading` is true, stack frames can be retrieved in a piecemeal way with the `startFrame` and `levels` arguments. The response of the `stackTrace` request may contain a `totalFrames` property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of `totalFrames` decide how to proceed. In any case a client should be prepared to receive fewer frames than requested, which is an indication that the end of the stack has been reached. *) module Stack_trace_command : sig val type_ : string module Arguments : sig - (** Arguments for 'stackTrace' request. *) + (** Arguments for `stackTrace` request. *) type t = { thread_id : int [@key "threadId"]; (** Retrieve the stacktrace for this thread. *) start_frame : int option [@key "startFrame"] [@default None]; (** The index of the first frame to return; if omitted frames start at 0. *) levels : int option [@default None]; (** The maximum number of frames to return. If levels is not specified or 0, all frames are returned. *) format : Stack_frame_format.t option [@default None]; (** Specifies details on how to format the stack frames. - The attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true. *) + The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true. *) } [@@deriving make, yojson {strict = false}] end module Result : sig type t = { - stack_frames : Stack_frame.t list [@key "stackFrames"]; (** The frames of the stackframe. If the array has length zero, there are no stackframes available. + stack_frames : Stack_frame.t list [@key "stackFrames"]; (** The frames of the stack frame. If the array has length zero, there are no stack frames available. This means that there is no location information available. *) - total_frames : int option [@key "totalFrames"] [@default None]; (** The total number of frames available in the stack. If omitted or if totalFrames is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). Returning monotonically increasing totalFrames values for subsequent requests can be used to enforce paging in the client. *) + total_frames : int option [@key "totalFrames"] [@default None]; (** The total number of frames available in the stack. If omitted or if `totalFrames` is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). Returning monotonically increasing `totalFrames` values for subsequent requests can be used to enforce paging in the client. *) } [@@deriving make, yojson {strict = false}] end end -(** The request returns the variable scopes for a given stackframe ID. *) +(** The request returns the variable scopes for a given stack frame ID. *) module Scopes_command : sig val type_ : string module Arguments : sig - (** Arguments for 'scopes' request. *) + (** Arguments for `scopes` request. *) type t = { - frame_id : int [@key "frameId"]; (** Retrieve the scopes for this stackframe. *) + frame_id : int [@key "frameId"]; (** Retrieve the scopes for the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end module Result : sig type t = { - scopes : Scope.t list; (** The scopes of the stackframe. If the array has length zero, there are no scopes available. *) + scopes : Scope.t list; (** The scopes of the stack frame. If the array has length zero, there are no scopes available. *) } [@@deriving make, yojson {strict = false}] end end (** 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. *) +A filter can be used to limit the fetched children to either named or indexed children. *) module Variables_command : sig val type_ : string module Arguments : sig module Filter : sig - (** Optional filter to limit the child variables to either named or indexed. If omitted, both types are fetched. *) + (** Filter to limit the child variables to either named or indexed. If omitted, both types are fetched. *) type t = | Indexed [@name "indexed"] | Named [@name "named"] @@ -1712,14 +1869,16 @@ module Variables_command : sig include JSONABLE with type t := t end - (** Arguments for 'variables' request. *) + (** Arguments for `variables` request. *) type t = { - variables_reference : int [@key "variablesReference"]; (** The Variable reference. *) - filter : Filter.t option [@default None]; (** Optional filter to limit the child variables to either named or indexed. If omitted, both types are fetched. *) - start : int option [@default None]; (** The index of the first variable to return; if omitted children start at 0. *) - count : int option [@default None]; (** The number of variables to return. If count is missing or 0, all variables are returned. *) + variables_reference : int [@key "variablesReference"]; (** The variable for which to retrieve its children. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) + filter : Filter.t option [@default None]; (** Filter to limit the child variables to either named or indexed. If omitted, both types are fetched. *) + start : int option [@default None]; (** The index of the first variable to return; if omitted children start at 0. + The attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true. *) + count : int option [@default None]; (** The number of variables to return. If count is missing or 0, all variables are returned. + The attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true. *) format : Value_format.t option [@default None]; (** Specifies details on how to format the Variable values. - The attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true. *) + The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true. *) } [@@deriving make, yojson {strict = false}] end @@ -1732,14 +1891,15 @@ module Variables_command : sig end end -(** Set the variable with the given name in the variable container to a new value. Clients should only call this request if the capability 'supportsSetVariable' is true. *) +(** Set the variable with the given name in the variable container to a new value. Clients should only call this request if the corresponding capability `supportsSetVariable` is true. +If a debug adapter implements both `setVariable` and `setExpression`, a client will only use `setExpression` if the variable has an `evaluateName` property. *) module Set_variable_command : sig val type_ : string module Arguments : sig - (** Arguments for 'setVariable' request. *) + (** Arguments for `setVariable` request. *) type t = { - variables_reference : int [@key "variablesReference"]; (** The reference of the variable container. *) + variables_reference : int [@key "variablesReference"]; (** The reference of the variable container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. *) name : string; (** The name of the variable in the container. *) value : string; (** The value of the variable. *) format : Value_format.t option [@default None]; (** Specifies details on how to format the response value. *) @@ -1751,14 +1911,21 @@ module Set_variable_command : sig type t = { value : string; (** The new value of the variable. *) type_ : string option [@key "type"] [@default None]; (** The type of the new value. Typically shown in the UI when hovering over the value. *) - variables_reference : int option [@key "variablesReference"] [@default None]; (** If variablesReference is > 0, the new value is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. - The value should be less than or equal to 2147483647 (2^31-1). *) + variables_reference : int option [@key "variablesReference"] [@default None]; (** If `variablesReference` is > 0, the new value is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. + + If this property is included in the response, any `variablesReference` previously associated with the updated variable, and those of its children, are no longer valid. *) named_variables : int option [@key "namedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) + memory_reference : string option [@key "memoryReference"] [@default None]; (** A memory reference to a location appropriate for this result. + For pointer type eval results, this is generally a reference to the memory address contained in the pointer. + This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true. *) + value_location_reference : int option [@key "valueLocationReference"] [@default None]; (** A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end @@ -1769,11 +1936,11 @@ module Source_command : sig val type_ : string module Arguments : sig - (** Arguments for 'source' request. *) + (** Arguments for `source` request. *) type t = { - source : Source.t option [@default None]; (** Specifies the source content to load. Either source.path or source.sourceReference must be specified. *) - source_reference : int [@key "sourceReference"]; (** The reference to the source. This is the same as source.sourceReference. - This is provided for backward compatibility since old backends do not understand the 'source' attribute. *) + source : Source.t option [@default None]; (** Specifies the source content to load. Either `source.path` or `source.sourceReference` must be specified. *) + source_reference : int [@key "sourceReference"]; (** The reference to the source. This is the same as `source.sourceReference`. + This is provided for backward compatibility since old clients do not understand the `source` attribute. *) } [@@deriving make, yojson {strict = false}] end @@ -1781,7 +1948,7 @@ module Source_command : sig module Result : sig type t = { content : string; (** Content of the source reference. *) - mime_type : string option [@key "mimeType"] [@default None]; (** Optional content type (mime type) of the source. *) + mime_type : string option [@key "mimeType"] [@default None]; (** Content type (MIME type) of the source. *) } [@@deriving make, yojson {strict = false}] end @@ -1805,12 +1972,12 @@ module Threads_command : sig end (** The request terminates the threads with the given ids. -Clients should only call this request if the capability 'supportsTerminateThreadsRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsTerminateThreadsRequest` is true. *) module Terminate_threads_command : sig val type_ : string module Arguments : sig - (** Arguments for 'terminateThreads' request. *) + (** Arguments for `terminateThreads` request. *) type t = { thread_ids : int list option [@key "threadIds"] [@default None]; (** Ids of threads to be terminated. *) } @@ -1824,15 +1991,15 @@ module Terminate_threads_command : sig end (** Modules can be retrieved from the debug adapter with this request which can either return all modules or a range of modules to support paging. -Clients should only call this request if the capability 'supportsModulesRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsModulesRequest` is true. *) module Modules_command : sig val type_ : string module Arguments : sig - (** Arguments for 'modules' request. *) + (** Arguments for `modules` request. *) type t = { start_module : int option [@key "startModule"] [@default None]; (** The index of the first module to return; if omitted modules start at 0. *) - module_count : int option [@key "moduleCount"] [@default None]; (** The number of modules to return. If moduleCount is not specified or 0, all modules are returned. *) + module_count : int option [@key "moduleCount"] [@default None]; (** The number of modules to return. If `moduleCount` is not specified or 0, all modules are returned. *) } [@@deriving make, yojson {strict = false}] end @@ -1847,12 +2014,12 @@ module Modules_command : sig end (** Retrieves the set of all sources currently loaded by the debugged process. -Clients should only call this request if the capability 'supportsLoadedSourcesRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsLoadedSourcesRequest` is true. *) module Loaded_sources_command : sig val type_ : string module Arguments : sig - (** Arguments for 'loadedSources' request. *) + (** Arguments for `loadedSources` request. *) type t = Empty_dict.t [@@deriving yojson] end @@ -1865,31 +2032,37 @@ module Loaded_sources_command : sig end end -(** Evaluates the given expression in the context of the top most stack frame. +(** Evaluates the given expression in the context of a stack frame. The expression has access to any variables and arguments that are in scope. *) module Evaluate_command : sig val type_ : string module Arguments : sig module Context : sig - (** The context in which the evaluate request is run. *) + (** The context in which the evaluate request is used. *) type t = | Watch [@name "watch"] | Repl [@name "repl"] | Hover [@name "hover"] | Clipboard [@name "clipboard"] + | Variables [@name "variables"] | Custom of string include JSONABLE with type t := t end - (** Arguments for 'evaluate' request. *) + (** Arguments for `evaluate` request. *) type t = { expression : string; (** The expression to evaluate. *) frame_id : int option [@key "frameId"] [@default None]; (** Evaluate the expression in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. *) - context : Context.t option [@default None]; (** The context in which the evaluate request is run. *) - format : Value_format.t option [@default None]; (** Specifies details on how to format the Evaluate result. - The attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true. *) + line : int option [@default None]; (** The contextual line where the expression should be evaluated. In the 'hover' context, this should be set to the start of the expression being hovered. *) + column : int option [@default None]; (** The contextual column where the expression should be evaluated. This may be provided if `line` is also provided. + + It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + source : Source.t option [@default None]; (** The contextual source in which the `line` is found. This must be provided if `line` is provided. *) + context : Context.t option [@default None]; (** The context in which the evaluate request is used. *) + format : Value_format.t option [@default None]; (** Specifies details on how to format the result. + The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true. *) } [@@deriving make, yojson {strict = false}] end @@ -1897,33 +2070,36 @@ module Evaluate_command : sig module Result : sig type t = { result : string; (** The result of the evaluate request. *) - type_ : string option [@key "type"] [@default None]; (** The optional type of the evaluate result. - This attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request. *) - presentation_hint : Variable_presentation_hint.t option [@key "presentationHint"] [@default None]; (** Properties of a evaluate result that can be used to determine how to render the result in the UI. *) - variables_reference : int [@key "variablesReference"]; (** If variablesReference is > 0, the evaluate result is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. - The value should be less than or equal to 2147483647 (2^31-1). *) + type_ : string option [@key "type"] [@default None]; (** The type of the evaluate result. + This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true. *) + presentation_hint : Variable_presentation_hint.t option [@key "presentationHint"] [@default None]; (** Properties of an evaluate result that can be used to determine how to render the result in the UI. *) + variables_reference : int [@key "variablesReference"]; (** If `variablesReference` is > 0, the evaluate result is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) named_variables : int option [@key "namedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) - memory_reference : string option [@key "memoryReference"] [@default None]; (** Optional memory reference to a location appropriate for this result. + memory_reference : string option [@key "memoryReference"] [@default None]; (** A memory reference to a location appropriate for this result. For pointer type eval results, this is generally a reference to the memory address contained in the pointer. - This attribute should be returned by a debug adapter if the client has passed the value true for the 'supportsMemoryReferences' capability of the 'initialize' request. *) + This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true. *) + value_location_reference : int option [@key "valueLocationReference"] [@default None]; (** A reference that allows the client to request the location where the returned value is declared. For example, if a function pointer is returned, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end end -(** Evaluates the given 'value' expression and assigns it to the 'expression' which must be a modifiable l-value. +(** Evaluates the given `value` expression and assigns it to the `expression` which must be a modifiable l-value. The expressions have access to any variables and arguments that are in scope of the specified frame. -Clients should only call this request if the capability 'supportsSetExpression' is true. *) +Clients should only call this request if the corresponding capability `supportsSetExpression` is true. +If a debug adapter implements both `setExpression` and `setVariable`, a client uses `setExpression` if the variable has an `evaluateName` property. *) module Set_expression_command : sig val type_ : string module Arguments : sig - (** Arguments for 'setExpression' request. *) + (** Arguments for `setExpression` request. *) type t = { expression : string; (** The l-value expression to assign to. *) value : string; (** The value expression to assign to the l-value expression. *) @@ -1936,57 +2112,61 @@ module Set_expression_command : sig module Result : sig type t = { value : string; (** The new value of the expression. *) - type_ : string option [@key "type"] [@default None]; (** The optional type of the value. - This attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request. *) + type_ : string option [@key "type"] [@default None]; (** The type of the value. + This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true. *) presentation_hint : Variable_presentation_hint.t option [@key "presentationHint"] [@default None]; (** Properties of a value that can be used to determine how to render the result in the UI. *) - variables_reference : int option [@key "variablesReference"] [@default None]; (** If variablesReference is > 0, the value is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. - The value should be less than or equal to 2147483647 (2^31-1). *) + variables_reference : int option [@key "variablesReference"] [@default None]; (** If `variablesReference` is > 0, the evaluate result is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. *) named_variables : int option [@key "namedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) indexed_variables : int option [@key "indexedVariables"] [@default None]; (** 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. + The client can use this information to present the variables in a paged UI and fetch them in chunks. The value should be less than or equal to 2147483647 (2^31-1). *) + memory_reference : string option [@key "memoryReference"] [@default None]; (** A memory reference to a location appropriate for this result. + For pointer type eval results, this is generally a reference to the memory address contained in the pointer. + This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true. *) + value_location_reference : int option [@key "valueLocationReference"] [@default None]; (** A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location. + + This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details. *) } [@@deriving make, yojson {strict = false}] end end -(** This request retrieves the possible stepIn targets for the specified stack frame. -These targets can be used in the 'stepIn' request. -The StepInTargets may only be called if the 'supportsStepInTargetsRequest' capability exists and is true. -Clients should only call this request if the capability 'supportsStepInTargetsRequest' is true. *) +(** This request retrieves the possible step-in targets for the specified stack frame. +These targets can be used in the `stepIn` request. +Clients should only call this request if the corresponding capability `supportsStepInTargetsRequest` is true. *) module Step_in_targets_command : sig val type_ : string module Arguments : sig - (** Arguments for 'stepInTargets' request. *) + (** Arguments for `stepInTargets` request. *) type t = { - frame_id : int [@key "frameId"]; (** The stack frame for which to retrieve the possible stepIn targets. *) + frame_id : int [@key "frameId"]; (** The stack frame for which to retrieve the possible step-in targets. *) } [@@deriving make, yojson {strict = false}] end module Result : sig type t = { - targets : Step_in_target.t list; (** The possible stepIn targets of the specified source location. *) + targets : Step_in_target.t list; (** The possible step-in targets of the specified source location. *) } [@@deriving make, yojson {strict = false}] end end (** This request retrieves the possible goto targets for the specified source location. -These targets can be used in the 'goto' request. -Clients should only call this request if the capability 'supportsGotoTargetsRequest' is true. *) +These targets can be used in the `goto` request. +Clients should only call this request if the corresponding capability `supportsGotoTargetsRequest` is true. *) module Goto_targets_command : sig val type_ : string module Arguments : sig - (** Arguments for 'gotoTargets' request. *) + (** Arguments for `gotoTargets` request. *) type t = { source : Source.t; (** The source location for which the goto targets are determined. *) line : int; (** The line location for which the goto targets are determined. *) - column : int option [@default None]; (** An optional column location for which the goto targets are determined. *) + column : int option [@default None]; (** The position within `line` for which the goto targets are determined. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) } [@@deriving make, yojson {strict = false}] end @@ -2000,17 +2180,17 @@ module Goto_targets_command : sig end (** Returns a list of possible completions for a given caret position and text. -Clients should only call this request if the capability 'supportsCompletionsRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsCompletionsRequest` is true. *) module Completions_command : sig val type_ : string module Arguments : sig - (** Arguments for 'completions' request. *) + (** Arguments for `completions` request. *) type t = { frame_id : int option [@key "frameId"] [@default None]; (** Returns completions in the scope of this stack frame. If not specified, the completions are returned for the global scope. *) - text : string; (** One or more source lines. Typically this is the text a user has typed into the debug console before he asked for completion. *) - column : int; (** The character position for which to determine the completion proposals. *) - line : int option [@default None]; (** An optional line for which to determine the completion proposals. If missing the first line of the text is assumed. *) + text : string; (** One or more source lines. Typically this is the text users have typed into the debug console before they asked for completion. *) + column : int; (** The position within `text` for which to determine the completion proposals. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + line : int option [@default None]; (** A line for which to determine the completion proposals. If missing the first line of the text is assumed. *) } [@@deriving make, yojson {strict = false}] end @@ -2024,12 +2204,12 @@ module Completions_command : sig end (** Retrieves the details of the exception that caused this event to be raised. -Clients should only call this request if the capability 'supportsExceptionInfoRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsExceptionInfoRequest` is true. *) module Exception_info_command : sig val type_ : string module Arguments : sig - (** Arguments for 'exceptionInfo' request. *) + (** Arguments for `exceptionInfo` request. *) type t = { thread_id : int [@key "threadId"]; (** Thread for which exception information should be retrieved. *) } @@ -2039,7 +2219,7 @@ module Exception_info_command : sig module Result : sig type t = { exception_id : string [@key "exceptionId"]; (** ID of the exception that was thrown. *) - description : string option [@default None]; (** Descriptive text for the exception provided by the debug adapter. *) + description : string option [@default None]; (** Descriptive text for the exception. *) break_mode : Exception_break_mode.t [@key "breakMode"]; (** Mode that caused the exception notification to be raised. *) details : Exception_details.t option [@default None]; (** Detailed information about the exception. *) } @@ -2048,15 +2228,15 @@ module Exception_info_command : sig end (** Reads bytes from memory at the provided location. -Clients should only call this request if the capability 'supportsReadMemoryRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsReadMemoryRequest` is true. *) module Read_memory_command : sig val type_ : string module Arguments : sig - (** Arguments for 'readMemory' request. *) + (** Arguments for `readMemory` request. *) type t = { memory_reference : string [@key "memoryReference"]; (** Memory reference to the base location from which data should be read. *) - offset : int option [@default None]; (** Optional offset (in bytes) to be applied to the reference location before reading data. Can be negative. *) + offset : int option [@default None]; (** Offset (in bytes) to be applied to the reference location before reading data. Can be negative. *) count : int; (** Number of bytes to read at the specified location and offset. *) } [@@deriving make, yojson {strict = false}] @@ -2065,26 +2245,52 @@ module Read_memory_command : sig module Result : sig type t = { address : string; (** The address of the first byte of data returned. - Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. *) + Treated as a hex value if prefixed with `0x`, or as a decimal value otherwise. *) unreadable_bytes : int option [@key "unreadableBytes"] [@default None]; (** The number of unreadable bytes encountered after the last successfully read byte. - This can be used to determine the number of bytes that must be skipped before a subsequent 'readMemory' request will succeed. *) - data : string option [@default None]; (** The bytes read from memory, encoded using base64. *) + This can be used to determine the number of bytes that should be skipped before a subsequent `readMemory` request succeeds. *) + data : string option [@default None]; (** The bytes read from memory, encoded using base64. If the decoded length of `data` is less than the requested `count` in the original `readMemory` request, and `unreadableBytes` is zero or omitted, then the client should assume it's reached the end of readable memory. *) + } + [@@deriving make, yojson {strict = false}] + end +end + +(** Writes bytes to memory at the provided location. +Clients should only call this request if the corresponding capability `supportsWriteMemoryRequest` is true. *) +module Write_memory_command : sig + val type_ : string + + module Arguments : sig + (** Arguments for `writeMemory` request. *) + type t = { + memory_reference : string [@key "memoryReference"]; (** Memory reference to the base location to which data should be written. *) + offset : int option [@default None]; (** Offset (in bytes) to be applied to the reference location before writing data. Can be negative. *) + allow_partial : bool option [@key "allowPartial"] [@default None]; (** Property to control partial writes. If true, the debug adapter should attempt to write memory even if the entire memory region is not writable. In such a case the debug adapter should stop after hitting the first byte of memory that cannot be written and return the number of bytes written in the response via the `offset` and `bytesWritten` properties. + If false or missing, a debug adapter should attempt to verify the region is writable before writing, and fail the response if it is not. *) + data : string; (** Bytes to write, encoded using base64. *) + } + [@@deriving make, yojson {strict = false}] + end + + module Result : sig + type t = { + offset : int option [@default None]; (** Property that should be returned when `allowPartial` is true to indicate the offset of the first byte of data successfully written. Can be negative. *) + bytes_written : int option [@key "bytesWritten"] [@default None]; (** Property that should be returned when `allowPartial` is true to indicate the number of bytes starting from address that were successfully written. *) } [@@deriving make, yojson {strict = false}] end end (** Disassembles code stored at the provided location. -Clients should only call this request if the capability 'supportsDisassembleRequest' is true. *) +Clients should only call this request if the corresponding capability `supportsDisassembleRequest` is true. *) module Disassemble_command : sig val type_ : string module Arguments : sig - (** Arguments for 'disassemble' request. *) + (** Arguments for `disassemble` request. *) type t = { memory_reference : string [@key "memoryReference"]; (** Memory reference to the base location containing the instructions to disassemble. *) - offset : int option [@default None]; (** Optional offset (in bytes) to be applied to the reference location before disassembling. Can be negative. *) - instruction_offset : int option [@key "instructionOffset"] [@default None]; (** Optional offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative. *) + offset : int option [@default None]; (** Offset (in bytes) to be applied to the reference location before disassembling. Can be negative. *) + instruction_offset : int option [@key "instructionOffset"] [@default None]; (** Offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative. *) instruction_count : int [@key "instructionCount"]; (** Number of instructions to disassemble starting at the specified location and offset. An adapter must return exactly this number of instructions - any unavailable instructions should be replaced with an implementation-defined 'invalid instruction' value. *) resolve_symbols : bool option [@key "resolveSymbols"] [@default None]; (** If true, the adapter should attempt to resolve memory addresses and other values to symbolic names. *) @@ -2100,3 +2306,27 @@ module Disassemble_command : sig end end +(** Looks up information about a location reference previously returned by the debug adapter. *) +module Locations_command : sig + val type_ : string + + module Arguments : sig + (** Arguments for `locations` request. *) + type t = { + location_reference : int [@key "locationReference"]; (** Location reference to resolve. *) + } + [@@deriving make, yojson {strict = false}] + end + + module Result : sig + type t = { + source : Source.t; (** The source containing the location; either `source.path` or `source.sourceReference` must be specified. *) + line : int; (** The line number of the location. The client capability `linesStartAt1` determines whether it is 0- or 1-based. *) + column : int option [@default None]; (** Position of the location within the `line`. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed. *) + end_line : int option [@key "endLine"] [@default None]; (** End line of the location, present if the location refers to a range. The client capability `linesStartAt1` determines whether it is 0- or 1-based. *) + end_column : int option [@key "endColumn"] [@default None]; (** End position of the location within `endLine`, present if the location refers to a range. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. *) + } + [@@deriving make, yojson {strict = false}] + end +end + diff --git a/src/debug_protocol/dune b/src/debug_protocol/dune index 85285c7..b2bef42 100644 --- a/src/debug_protocol/dune +++ b/src/debug_protocol/dune @@ -7,11 +7,11 @@ (rule (target debug_protocol.ml) (mode (promote (until-clean))) - (deps (:json ../../debugAdapterProtocol.json) ../../scripts/gen_protocol_ml.js) - (action (with-stdout-to %{target} (run node ../../scripts/gen_protocol_ml.js -- %{json})))) + (deps (:json ../../debugAdapterProtocol.json) (:script ../../scripts/gen_protocol.js)) + (action (with-stdout-to %{target} (run node %{script} -- ml %{json})))) (rule (target debug_protocol.mli) (mode (promote (until-clean))) - (deps (:json ../../debugAdapterProtocol.json) ../../scripts/gen_protocol_mli.js) - (action (with-stdout-to %{target} (run node ../../scripts/gen_protocol_mli.js -- %{json})))) + (deps (:json ../../debugAdapterProtocol.json) (:script ../../scripts/gen_protocol.js)) + (action (with-stdout-to %{target} (run node %{script} -- mli %{json})))) diff --git a/src/debug_rpc_test/debug_rpc_test.ml b/src/debug_rpc_test/debug_rpc_test.ml index 54617c0..f52df2b 100644 --- a/src/debug_rpc_test/debug_rpc_test.ml +++ b/src/debug_rpc_test/debug_rpc_test.ml @@ -88,7 +88,8 @@ let%expect_test "exec_command" = Format.printf "bar: %s\n" res.bar; [%expect {| foo: 1000 - bar: 2000 |}] + bar: 2000 |}]; + Lwt.return () let%expect_test "cancellation" = let client_rpc, server_rpc = create_rpc_pair () in @@ -138,7 +139,8 @@ let%expect_test "cancellation" = 3 1 2 - 5 |}] + 5 |}]; + Lwt.return () let%expect_test "send_event" = let client_rpc, server_rpc = create_rpc_pair () in @@ -170,4 +172,5 @@ let%expect_test "send_event" = 1 2 3 - 4 |}] + 4 |}]; + Lwt.return () diff --git a/src/debug_rpc_test/dune b/src/debug_rpc_test/dune index b249e50..a844cc2 100644 --- a/src/debug_rpc_test/dune +++ b/src/debug_rpc_test/dune @@ -3,4 +3,4 @@ (inline_tests) (preprocess (pps ppx_expect ppx_deriving.make ppx_deriving_yojson lwt_ppx)) - (libraries debug_protocol debug_rpc lwt lwt.unix lwt_react logs logs.cli react fmt logs.fmt)) + (libraries debug_protocol debug_rpc lwt lwt.unix lwt_react logs logs.fmt react fmt)) diff --git a/src/debug_rpc_test/lwt_expect.ml b/src/debug_rpc_test/lwt_expect.ml index b04c461..b8f0f30 100644 --- a/src/debug_rpc_test/lwt_expect.ml +++ b/src/debug_rpc_test/lwt_expect.ml @@ -1,19 +1,8 @@ -module Lwt_io_run = struct - type 'a t = 'a Lwt.t -end - -module Lwt_io_flush = struct - type 'a t = 'a Lwt.t - let return x = Lwt.return x - let bind x ~f = Lwt.bind x f - let to_run x = x -end - module Expect_test_config = struct - module IO_run = Lwt_io_run - module IO_flush = Lwt_io_flush + include Expect_test_config + module IO = struct + type 'a t = 'a Lwt.t + let return x = Lwt.return x + end let run x = Lwt_main.run (x ()) - let flush () = Lwt_io.flush_all () - let flushed () = Lwt_io.(buffered stdout = 0) - let upon_unreleasable_issue = `CR end diff --git a/yarn.lock b/yarn.lock index 372ed2c..be3af62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,42 +2,54 @@ # yarn lockfile v1 +"@tootallnate/once@1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" + integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== + "@types/jsdom@^16.2.5": - version "16.2.5" - resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-16.2.5.tgz#74ebad438741d249ecb416c5486dcde4217eb66c" - integrity sha512-k/ZaTXtReAjwWu0clU0KLS53dyqZnA8mm+jwKFeFrvufXgICp+VNbskETFxKKAguv0pkaEKTax5MaRmvalM+TA== + version "16.2.15" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-16.2.15.tgz#6c09990ec43b054e49636cba4d11d54367fc90d6" + integrity sha512-nwF87yjBKuX/roqGYerZZM0Nv1pZDMAT5YhOHYeM/72Fic+VEqJh4nyoqoapzJnW3pUlfxPY5FhgsJtM+dRnQQ== dependencies: "@types/node" "*" - "@types/parse5" "*" + "@types/parse5" "^6.0.3" "@types/tough-cookie" "*" "@types/node-fetch@^2.5.7": - version "2.5.7" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" - integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== + version "2.6.12" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.12.tgz#8ab5c3ef8330f13100a7479e2cd56d3386830a03" + integrity sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.0" -"@types/node@*", "@types/node@^14.14.10": - version "14.14.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.10.tgz#5958a82e41863cfc71f2307b3748e3491ba03785" - integrity sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ== +"@types/node@*": + version "22.10.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.2.tgz#a485426e6d1fdafc7b0d4c7b24e2c78182ddabb9" + integrity sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ== + dependencies: + undici-types "~6.20.0" -"@types/parse5@*": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" - integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw== +"@types/node@^14.14.10": + version "14.18.63" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.63.tgz#1788fa8da838dbb5f9ea994b834278205db6ca2b" + integrity sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ== + +"@types/parse5@^6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" + integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== "@types/tough-cookie@*": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.0.tgz#fef1904e4668b6e5ecee60c52cc6a078ffa6697d" - integrity sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A== + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" + integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== -abab@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" - integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== +abab@^2.0.3, abab@^2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== acorn-globals@^6.0.0: version "6.0.0" @@ -57,20 +69,22 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -ajv@^6.12.3: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== +acorn@^8.2.4: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" + debug "4" -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^4.0.0: version "4.3.0" @@ -79,50 +93,16 @@ ansi-styles@^4.0.0: dependencies: color-convert "^2.0.1" -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== browser-process-hrtime@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -144,18 +124,13 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - cssom@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" @@ -166,20 +141,13 @@ cssom@~0.3.6: resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== -cssstyle@^2.2.0: +cssstyle@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== dependencies: cssom "~0.3.6" -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - data-urls@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" @@ -189,20 +157,22 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -decimal.js@^10.2.0: - version "10.2.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" - integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== +debug@4: + version "4.4.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== + dependencies: + ms "^2.1.3" -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +decimal.js@^10.2.1: + version "10.4.3" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== domexception@^2.0.1: version "2.0.1" @@ -211,33 +181,24 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== -escodegen@^1.14.1: - version "1.14.3" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== +escodegen@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" + integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== dependencies: esprima "^4.0.1" - estraverse "^4.2.0" + estraverse "^5.2.0" esutils "^2.0.2" - optionator "^0.8.1" optionalDependencies: source-map "~0.6.1" @@ -246,67 +207,32 @@ esprima@^4.0.1: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -estraverse@^4.2.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== + version "3.0.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.2.tgz#83ad9ced7c03feaad97e293d6f6091011e1659c8" + integrity sha512-sJe+TQb2vIaIyO783qN6BlMYWMw3WBOHA1Ay2qxsnjuafEOQFJ2JakedOQirT6D5XPRxDvS7AHYyem9fTpb4LQ== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== +form-data@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.1.tgz#ba1076daaaa5bfd7e99c1a6cb02aa0a5cff90d48" + integrity sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== dependencies: asynckit "^0.4.0" - combined-stream "^1.0.6" + combined-stream "^1.0.8" mime-types "^2.1.12" get-caller-file@^2.0.5: @@ -314,26 +240,6 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - html-encoding-sniffer@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" @@ -341,14 +247,22 @@ html-encoding-sniffer@^2.0.1: dependencies: whatwg-encoding "^1.0.5" -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= +http-proxy-agent@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" + integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== + dependencies: + "@tootallnate/once" "1" + agent-base "6" + debug "4" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" + agent-base "6" + debug "4" iconv-lite@0.4.24: version "0.4.24" @@ -357,238 +271,121 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ip-regex@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-potential-custom-element-name@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397" - integrity sha1-DFLlS8yjkbssSUsh6GJtczbG45c= - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +is-potential-custom-element-name@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== jsdom@^16.4.0: - version "16.4.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.4.0.tgz#36005bde2d136f73eee1a830c6d45e55408edddb" - integrity sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w== + version "16.7.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" + integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== dependencies: - abab "^2.0.3" - acorn "^7.1.1" + abab "^2.0.5" + acorn "^8.2.4" acorn-globals "^6.0.0" cssom "^0.4.4" - cssstyle "^2.2.0" + cssstyle "^2.3.0" data-urls "^2.0.0" - decimal.js "^10.2.0" + decimal.js "^10.2.1" domexception "^2.0.1" - escodegen "^1.14.1" + escodegen "^2.0.0" + form-data "^3.0.0" html-encoding-sniffer "^2.0.1" - is-potential-custom-element-name "^1.0.0" + http-proxy-agent "^4.0.1" + https-proxy-agent "^5.0.0" + is-potential-custom-element-name "^1.0.1" nwsapi "^2.2.0" - parse5 "5.1.1" - request "^2.88.2" - request-promise-native "^1.0.8" - saxes "^5.0.0" + parse5 "6.0.1" + saxes "^5.0.1" symbol-tree "^3.2.4" - tough-cookie "^3.0.1" + tough-cookie "^4.0.0" w3c-hr-time "^1.0.2" w3c-xmlserializer "^2.0.0" webidl-conversions "^6.1.0" whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" - ws "^7.2.3" + whatwg-url "^8.5.0" + ws "^7.4.6" xml-name-validator "^3.0.0" -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +lodash@^4.17.20, lodash@^4.7.0: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= - -lodash@^4.17.19, lodash@^4.17.20: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + mime-db "1.52.0" -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" +ms@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" nwsapi@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" - integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -parse5@5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" - integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + version "2.2.16" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.16.tgz#177760bba02c351df1d2644e220c31dfec8cdb43" + integrity sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ== -psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== +parse5@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +psl@^1.1.33: + version "1.15.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" + integrity sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w== + dependencies: + punycode "^2.3.1" -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== +punycode@^2.1.1, punycode@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== -request-promise-core@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" - integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== - dependencies: - lodash "^4.17.19" - -request-promise-native@^1.0.8: - version "1.0.9" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" - integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== - dependencies: - request-promise-core "1.1.4" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - -request@^2.88.2: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -safe-buffer@^5.0.1, safe-buffer@^5.1.2: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -saxes@^5.0.0: +saxes@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== @@ -600,110 +397,66 @@ source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= - string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: - ansi-regex "^5.0.0" + ansi-regex "^5.0.1" symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -tough-cookie@^2.3.3, tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tough-cookie@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" - integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== +tough-cookie@^4.0.0: + version "4.1.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" + integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== dependencies: - ip-regex "^2.1.0" - psl "^1.1.28" + psl "^1.1.33" punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" -tr46@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479" - integrity sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg== +tr46@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" + integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== dependencies: punycode "^2.1.1" -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -uri-js@^4.2.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" - integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== - dependencies: - punycode "^2.1.0" +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" + querystringify "^2.1.1" + requires-port "^1.0.0" w3c-hr-time@^1.0.2: version "1.0.2" @@ -719,6 +472,11 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + webidl-conversions@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" @@ -741,20 +499,23 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@^8.0.0: - version "8.4.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.4.0.tgz#50fb9615b05469591d2b2bd6dfaed2942ed72837" - integrity sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw== +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +whatwg-url@^8.0.0, whatwg-url@^8.5.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" + integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: - lodash.sortby "^4.7.0" - tr46 "^2.0.2" + lodash "^4.7.0" + tr46 "^2.1.0" webidl-conversions "^6.1.0" -word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -764,10 +525,10 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" -ws@^7.2.3: - version "7.4.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.0.tgz#a5dd76a24197940d4a8bb9e0e152bb4503764da7" - integrity sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ== +ws@^7.4.6: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== xml-name-validator@^3.0.0: version "3.0.0" @@ -780,19 +541,19 @@ xmlchars@^2.2.0: integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== y18n@^5.0.5: - version "5.0.5" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" - integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yargs-parser@^20.2.2: - version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs@^16.1.1: - version "16.1.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.1.1.tgz#5a4a095bd1ca806b0a50d0c03611d38034d219a1" - integrity sha512-hAD1RcFP/wfgfxgMVswPE+z3tlPFtxG8/yWUrG2i17sTWGCGqWnxKcLTF4cUKDUK8fzokwsmO9H0TDkRbMHy8w== + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" escalade "^3.1.1"