Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit 4beecf1

Browse files
committed
Option to set backend for delve
1 parent 0d57112 commit 4beecf1

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,15 @@
328328
"type": "string",
329329
"description": "Absolute path to a file containing environment variable definitions.",
330330
"default": "${workspaceRoot}/.env"
331+
},
332+
"backend": {
333+
"type": "string",
334+
"enum": [
335+
"default",
336+
"native",
337+
"lldb"
338+
],
339+
"description": "Backend used by delve. Only available in delve version 0.12.2 and above."
331340
}
332341
}
333342
}

src/debugAdapter/goDebug.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ interface LaunchRequestArguments extends DebugProtocol.LaunchRequestArguments {
140140
trace?: boolean|'verbose';
141141
/** Optional path to .env file. */
142142
envFile?: string;
143+
backend?: string;
143144
}
144145

145146
process.on('uncaughtException', (err: any) => {
@@ -283,11 +284,13 @@ class Delve {
283284
if (launchArgs.init) {
284285
dlvArgs = dlvArgs.concat(['--init=' + launchArgs.init]);
285286
}
287+
if (launchArgs.backend) {
288+
dlvArgs = dlvArgs.concat(['--backend=' + launchArgs.backend]);
289+
}
286290
if (launchArgs.args) {
287291
dlvArgs = dlvArgs.concat(['--', ...launchArgs.args]);
288292
}
289293

290-
291294
this.debugProcess = spawn(dlv, dlvArgs, {
292295
cwd: dlvCwd,
293296
env,

0 commit comments

Comments
 (0)