2121#define LLDB_TOOLS_LLDB_DAP_PROTOCOL_H
2222
2323#include " llvm/Support/JSON.h"
24- #include < cstddef>
2524#include < cstdint>
2625#include < optional>
2726#include < string>
@@ -85,9 +84,6 @@ bool fromJSON(const llvm::json::Value &, Request &, llvm::json::Path);
8584struct Event {
8685 std::string event;
8786 std::optional<llvm::json::Value> rawBody;
88-
89- // / lldb-dap specific extension on the 'terminated' event specifically.
90- std::optional<llvm::json::Value> statistics;
9187};
9288llvm::json::Value toJSON (const Event &);
9389bool fromJSON (const llvm::json::Value &, Event &, llvm::json::Path);
@@ -122,9 +118,9 @@ bool fromJSON(const llvm::json::Value &, Event &, llvm::json::Path);
122118// " "is not shown in the UI.\nSome predefined values exist.",
123119// "_enum" : [ "cancelled", "notStopped" ],
124120// "enumDescriptions" : [
125- // "the request was cancelled.", "the request may be retried once
126- // the "
127- // "adapter is in a 'stopped' state."
121+ // "the request was cancelled.",
122+ // " the request may be retried once the adapter is in a 'stopped'
123+ // state."
128124// ]
129125// },
130126// "body" : {
@@ -142,14 +138,75 @@ bool fromJSON(const llvm::json::Value &, Event &, llvm::json::Path);
142138// }
143139struct Response {
144140 int64_t request_seq;
145- bool success;
146141 std::string command;
142+ bool success;
147143 std::optional<std::string> message;
148144 std::optional<llvm::json::Value> rawBody;
149145};
150146bool fromJSON (const llvm::json::Value &, Response &, llvm::json::Path);
151147llvm::json::Value toJSON (const Response &);
152148
149+ // "Message": {
150+ // "type": "object",
151+ // "description": "A structured message object. Used to return errors from
152+ // requests.", "properties": {
153+ // "id": {
154+ // "type": "integer",
155+ // "description": "Unique (within a debug adapter implementation)
156+ // identifier for the message. The purpose of these error IDs is to help
157+ // extension authors that have the requirement that every user visible
158+ // error message needs a corresponding error number, so that users or
159+ // customer support can find information about the specific error more
160+ // easily."
161+ // },
162+ // "format": {
163+ // "type": "string",
164+ // "description": "A format string for the message. Embedded variables
165+ // have the form `{name}`.\nIf variable name starts with an underscore
166+ // character, the variable does not contain user data (PII) and can be
167+ // safely used for telemetry purposes."
168+ // },
169+ // "variables": {
170+ // "type": "object",
171+ // "description": "An object used as a dictionary for looking up the
172+ // variables in the format string.", "additionalProperties": {
173+ // "type": "string",
174+ // "description": "All dictionary values must be strings."
175+ // }
176+ // },
177+ // "sendTelemetry": {
178+ // "type": "boolean",
179+ // "description": "If true send to telemetry."
180+ // },
181+ // "showUser": {
182+ // "type": "boolean",
183+ // "description": "If true show user."
184+ // },
185+ // "url": {
186+ // "type": "string",
187+ // "description": "A url where additional information about this message
188+ // can be found."
189+ // },
190+ // "urlLabel": {
191+ // "type": "string",
192+ // "description": "A label that is presented to the user as the UI for
193+ // opening the url."
194+ // }
195+ // },
196+ // "required": [ "id", "format" ]
197+ // },
198+ struct ErrorMessage {
199+ uint64_t id;
200+ std::string format;
201+ std::optional<std::map<std::string, std::string>> variables;
202+ std::optional<bool > sendTelemetry;
203+ std::optional<bool > showUser;
204+ std::optional<std::string> url;
205+ std::optional<std::string> urlLabel;
206+ };
207+ bool fromJSON (const llvm::json::Value &, ErrorMessage &, llvm::json::Path);
208+ llvm::json::Value toJSON (const ErrorMessage &);
209+
153210// "ProtocolMessage": {
154211// "type": "object",
155212// "title": "Base Protocol",
0 commit comments