1{
2 "allOf": [
3 {
4 "if": { "properties": { "request": { "const": "launch" } }, "required": ["request"] },
5 "then": {
6 "required": [],
7 "properties": {
8 "debugAdapter": {
9 "enum": ["legacy", "dlv-dap"],
10 "description": "Select which debug adapter to use with this launch configuration.",
11 "default": "dlv-dap"
12 },
13 "program": {
14 "type": "string",
15 "description": "Path to the program folder (or any go file within that folder) when in `debug` or `test` mode, and to the pre-built binary file to debug in `exec` mode. If it is not an absolute path, the extension interprets it as a workspace relative path.",
16 "default": "${ZED_WORKTREE_ROOT}"
17 },
18 "mode": {
19 "enum": ["auto", "debug", "test", "exec", "replay", "core"],
20 "description": "One of `auto`, `debug`, `test`, `exec`, `replay`, `core`. In `auto` mode, the extension will choose either `debug` or `test` depending on active editor window.",
21 "default": "auto"
22 },
23 "traceDirPath": {
24 "type": "string",
25 "description": "Directory in which the record trace is located or to be created for a new output trace. For use on 'replay' mode only",
26 "default": ""
27 },
28 "coreFilePath": {
29 "type": "string",
30 "description": "Path to the core dump file to open. For use on 'core' mode only",
31 "default": ""
32 },
33 "stopOnEntry": {
34 "type": "boolean",
35 "description": "Automatically stop program after launch.",
36 "default": false
37 },
38 "args": {
39 "type": ["array", "string"],
40 "description": "Command line arguments passed to the debugged program.",
41 "items": { "type": "string" },
42 "default": []
43 },
44 "showLog": {
45 "type": "boolean",
46 "description": "Show log output from the delve debugger. Maps to dlv's `--log` flag.",
47 "default": false
48 },
49 "cwd": {
50 "type": "string",
51 "description": "Workspace relative or absolute path to the working directory of the program being debugged if a non-empty value is specified. The `program` folder is used as the working directory if `cwd` is omitted or empty.",
52 "default": ""
53 },
54 "env": {
55 "type": "object",
56 "description": "Environment variables passed to the launched debuggee program. Format as string key:value pairs. Merged with `envFile` and `go.toolsEnvVars` with precedence `env` > `envFile` > `go.toolsEnvVars`.",
57 "default": {}
58 },
59 "substitutePath": {
60 "type": "array",
61 "items": {
62 "type": "object",
63 "properties": {
64 "from": {
65 "type": "string",
66 "description": "The absolute local path to be replaced when passing paths to the debugger.",
67 "default": ""
68 },
69 "to": {
70 "type": "string",
71 "description": "The absolute remote path to be replaced when passing paths back to the client.",
72 "default": ""
73 }
74 }
75 },
76 "description": "An array of mappings from a local path (editor) to the remote path (debugee). This setting is useful when working in a file system with symbolic links, running remote debugging, or debugging an executable compiled externally. The debug adapter will replace the local path with the remote path in all of the calls.",
77 "default": []
78 },
79 "buildFlags": {
80 "type": ["string", "array"],
81 "items": { "type": "string" },
82 "description": "Build flags, to be passed to the Go compiler. Maps to dlv's `--build-flags` flag.",
83 "default": []
84 },
85 "dlvFlags": {
86 "type": "array",
87 "description": "Extra flags for `dlv`. See `dlv help` for the full list of supported. Flags such as `--log-output`, `--log`, `--log-dest`, `--api-version`, `--output`, `--backend` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.",
88 "items": { "type": "string" },
89 "default": []
90 },
91 "port": {
92 "type": "number",
93 "description": "When applied to remote-attach configurations, will look for \"dlv ... --headless --listen=<host>:<port>\" server started externally. In dlv-dap mode this will apply to all other configurations as well. The extension will try to connect to an external server started with \"dlv dap --listen=<host>:<port>\" to ask it to launch/attach to the target process.",
94 "default": 2345
95 },
96 "host": {
97 "type": "string",
98 "description": "When applied to remote-attach configurations, will look for \"dlv ... --headless --listen=<host>:<port>\" server started externally. In dlv-dap mode this will apply to all other configurations as well. The extension will try to connect to an external server started with \"dlv dap --listen=<host>:<port>\" to ask it to launch/attach to the target process.",
99 "default": "127.0.0.1"
100 },
101 "trace": {
102 "type": "string",
103 "enum": ["verbose", "trace", "log", "info", "warn", "error"],
104 "default": "error",
105 "description": "Various levels of logging shown in the debug console & 'Go Debug' output channel. When using the `legacy` debug adapter, the logs will also be written to a file if it is set to a value other than `error`."
106 },
107 "envFile": {
108 "type": ["string", "array"],
109 "items": { "type": "string" },
110 "description": "Absolute path to a file containing environment variable definitions, formatted as string key=value pairs. Multiple files can be specified by provided an array of absolute paths. Merged with `env` and `go.toolsEnvVars` with precedence `env` > `envFile` > `go.toolsEnvVars`. ",
111 "default": ""
112 },
113 "backend": {
114 "type": "string",
115 "enum": ["default", "native", "lldb", "rr"],
116 "description": "Backend used by delve. Maps to `dlv`'s `--backend` flag."
117 },
118 "output": {
119 "type": "string",
120 "description": "Output path for the binary of the debugee.",
121 "default": "debug"
122 },
123 "logOutput": {
124 "type": "string",
125 "enum": ["debugger", "gdbwire", "lldbout", "debuglineerr", "rpc", "dap"],
126 "description": "Comma separated list of components that should produce debug output. Maps to dlv's `--log-output` flag. Check `dlv log` for details.",
127 "default": "debugger"
128 },
129 "logDest": {
130 "type": "string",
131 "description": "dlv's `--log-dest` flag. See `dlv log` for details. Number argument is not allowed. Supported only in `dlv-dap` mode, and on Linux and Mac OS."
132 },
133 "dlvLoadConfig": {
134 "type": "object",
135 "properties": {
136 "followPointers": {
137 "type": "boolean",
138 "description": "FollowPointers requests pointers to be automatically dereferenced.",
139 "default": true
140 },
141 "maxVariableRecurse": {
142 "type": "number",
143 "description": "MaxVariableRecurse is how far to recurse when evaluating nested types.",
144 "default": 1
145 },
146 "maxStringLen": {
147 "type": "number",
148 "description": "MaxStringLen is the maximum number of bytes read from a string.",
149 "default": 64
150 },
151 "maxArrayValues": {
152 "type": "number",
153 "description": "MaxArrayValues is the maximum number of elements read from an array, a slice or a map.",
154 "default": 64
155 },
156 "maxStructFields": {
157 "type": "number",
158 "description": "MaxStructFields is the maximum number of fields read from a struct, -1 will read all fields.",
159 "default": -1
160 }
161 },
162 "description": "LoadConfig describes to delve, how to load values from target's memory. Not applicable when using `dlv-dap` mode.",
163 "default": {
164 "followPointers": true,
165 "maxVariableRecurse": 1,
166 "maxStringLen": 64,
167 "maxArrayValues": 64,
168 "maxStructFields": -1
169 }
170 },
171 "apiVersion": {
172 "type": "number",
173 "enum": [1, 2],
174 "description": "Delve Api Version to use. Default value is 2. Maps to dlv's `--api-version` flag. Not applicable when using `dlv-dap` mode.",
175 "default": 2
176 },
177 "stackTraceDepth": {
178 "type": "number",
179 "description": "Maximum depth of stack trace collected from Delve.",
180 "default": 50
181 },
182 "showGlobalVariables": {
183 "type": "boolean",
184 "default": false,
185 "description": "Boolean value to indicate whether global package variables should be shown in the variables pane or not."
186 },
187 "showRegisters": {
188 "type": "boolean",
189 "default": false,
190 "description": "Boolean value to indicate whether register variables should be shown in the variables pane or not."
191 },
192 "hideSystemGoroutines": {
193 "type": "boolean",
194 "default": false,
195 "description": "Boolean value to indicate whether system goroutines should be hidden from call stack view."
196 },
197 "console": {
198 "default": "internalConsole",
199 "description": "(Experimental) Where to launch the debugger and the debug target: internal console, integrated terminal, or external terminal. It is ignored in remote debugging.",
200 "enum": ["internalConsole", "integratedTerminal", "externalTerminal"]
201 },
202 "asRoot": {
203 "default": false,
204 "description": "(Experimental) Debug with elevated permissions (on Unix). It requires `integrated` or `external` console modes and is ignored in remote debugging.",
205 "type": "boolean"
206 }
207 }
208 }
209 },
210 {
211 "if": { "properties": { "request": { "const": "attach" } }, "required": ["request"] },
212 "then": {
213 "required": [],
214 "properties": {
215 "debugAdapter": {
216 "enum": ["legacy", "dlv-dap"],
217 "description": "Select which debug adapter to use with this launch configuration.",
218 "default": "dlv-dap"
219 },
220 "processId": {
221 "anyOf": [
222 {
223 "enum": ["${command:pickProcess}", "${command:pickGoProcess}"],
224 "description": "Use process picker to select a process to attach, or Process ID as integer."
225 },
226 {
227 "type": "string",
228 "description": "Attach to a process by name. If more than one process matches the name, use the process picker to select a process."
229 },
230 {
231 "type": "number",
232 "description": "The numeric ID of the process to be debugged. If 0, use the process picker to select a process."
233 }
234 ],
235 "default": 0
236 },
237 "mode": {
238 "enum": ["local", "remote"],
239 "description": "Indicates local or remote debugging. Local is similar to the `dlv attach` command, remote - to `dlv connect`",
240 "default": "local"
241 },
242 "stopOnEntry": {
243 "type": "boolean",
244 "description": "Automatically stop program after attach.",
245 "default": false
246 },
247 "dlvFlags": {
248 "type": "array",
249 "description": "Extra flags for `dlv`. See `dlv help` for the full list of supported. Flags such as `--log-output`, `--log`, `--log-dest`, `--api-version`, `--output`, `--backend` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.",
250 "items": { "type": "string" },
251 "default": []
252 },
253 "showLog": {
254 "type": "boolean",
255 "description": "Show log output from the delve debugger. Maps to dlv's `--log` flag.",
256 "default": false
257 },
258 "cwd": {
259 "type": "string",
260 "description": "Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.",
261 "default": "${ZED_WORKTREE_ROOT}"
262 },
263 "remotePath": {
264 "type": "string",
265 "description": "The path to the source code on the remote machine, when the remote path is different from the local machine. If specified, becomes the first entry in substitutePath. Not supported with `dlv-dap`.",
266 "markdownDeprecationMessage": "Use `substitutePath` instead.",
267 "default": ""
268 },
269 "port": {
270 "type": "number",
271 "description": "When applied to remote-attach configurations, will look for \"dlv ... --headless --listen=<host>:<port>\" server started externally. In dlv-dap mode, this will apply to all other configurations as well. The extension will try to connect to an external server started with \"dlv dap --listen=<host>:<port>\" to ask it to launch/attach to the target process.",
272 "default": 2345
273 },
274 "host": {
275 "type": "string",
276 "description": "When applied to remote-attach configurations, will look for \"dlv ... --headless --listen=<host>:<port>\" server started externally. In dlv-dap mode, this will apply to all other configurations as well. The extension will try to connect to an external server started with \"dlv dap --listen=<host>:<port>\" to ask it to launch/attach to the target process.",
277 "default": "127.0.0.1"
278 },
279 "substitutePath": {
280 "type": "array",
281 "items": {
282 "type": "object",
283 "properties": {
284 "from": {
285 "type": "string",
286 "description": "The absolute local path to be replaced when passing paths to the debugger.",
287 "default": ""
288 },
289 "to": {
290 "type": "string",
291 "description": "The absolute remote path to be replaced when passing paths back to the client.",
292 "default": ""
293 }
294 }
295 },
296 "description": "An array of mappings from a local path (editor) to the remote path (debugee). This setting is useful when working in a file system with symbolic links, running remote debugging, or debugging an executable compiled externally. The debug adapter will replace the local path with the remote path in all of the calls. Overridden by `remotePath`.",
297 "default": []
298 },
299 "trace": {
300 "type": "string",
301 "enum": ["verbose", "trace", "log", "info", "warn", "error"],
302 "default": "error",
303 "description": "Various levels of logging shown in the debug console & 'Go Debug' output channel. When using the `legacy` debug adapter, the logs will also be written to a file if it is set to a value other than `error`."
304 },
305 "backend": {
306 "type": "string",
307 "enum": ["default", "native", "lldb", "rr"],
308 "description": "Backend used by delve. Maps to `dlv`'s `--backend` flag."
309 },
310 "logOutput": {
311 "type": "string",
312 "enum": ["debugger", "gdbwire", "lldbout", "debuglineerr", "rpc", "dap"],
313 "description": "Comma separated list of components that should produce debug output. Maps to dlv's `--log-output` flag. Check `dlv log` for details.",
314 "default": "debugger"
315 },
316 "logDest": {
317 "type": "string",
318 "description": "dlv's `--log-dest` flag. See `dlv log` for details. Number argument is not allowed. Supported only in `dlv-dap` mode and on Linux and Mac OS."
319 },
320 "dlvLoadConfig": {
321 "type": "object",
322 "properties": {
323 "followPointers": {
324 "type": "boolean",
325 "description": "FollowPointers requests pointers to be automatically dereferenced",
326 "default": true
327 },
328 "maxVariableRecurse": {
329 "type": "number",
330 "description": "MaxVariableRecurse is how far to recurse when evaluating nested types",
331 "default": 1
332 },
333 "maxStringLen": {
334 "type": "number",
335 "description": "MaxStringLen is the maximum number of bytes read from a string",
336 "default": 64
337 },
338 "maxArrayValues": {
339 "type": "number",
340 "description": "MaxArrayValues is the maximum number of elements read from an array, a slice or a map",
341 "default": 64
342 },
343 "maxStructFields": {
344 "type": "number",
345 "description": "MaxStructFields is the maximum number of fields read from a struct, -1 will read all fields",
346 "default": -1
347 }
348 },
349 "description": "LoadConfig describes to delve, how to load values from target's memory. Not applicable when using `dlv-dap` mode.",
350 "default": {
351 "followPointers": true,
352 "maxVariableRecurse": 1,
353 "maxStringLen": 64,
354 "maxArrayValues": 64,
355 "maxStructFields": -1
356 }
357 },
358 "apiVersion": {
359 "type": "number",
360 "enum": [1, 2],
361 "description": "Delve Api Version to use. Default value is 2. Not applicable when using `dlv-dap` mode.",
362 "default": 2
363 },
364 "stackTraceDepth": {
365 "type": "number",
366 "description": "Maximum depth of stack trace collected from Delve.",
367 "default": 50
368 },
369 "showGlobalVariables": {
370 "type": "boolean",
371 "default": false,
372 "description": "Boolean value to indicate whether global package variables should be shown in the variables pane or not."
373 },
374 "showRegisters": {
375 "type": "boolean",
376 "default": false,
377 "description": "Boolean value to indicate whether register variables should be shown in the variables pane or not."
378 },
379 "hideSystemGoroutines": {
380 "type": "boolean",
381 "default": false,
382 "description": "Boolean value to indicate whether system goroutines should be hidden from call stack view."
383 },
384 "console": {
385 "default": "internalConsole",
386 "description": "(Experimental) Where to launch the debugger: internal console, integrated terminal, or external terminal. This does not affect tty of the running program. It is ignored in remote debugging.",
387 "enum": ["internalConsole", "integratedTerminal", "externalTerminal"]
388 },
389 "asRoot": {
390 "default": false,
391 "description": "(Experimental) Debug with elevated permissions (on Unix). This requires `integrated` or `external` console modes and is ignored in remote debugging.",
392 "type": "boolean"
393 }
394 }
395 }
396 }
397 ]
398}