diff --git a/package.json b/package.json index 4ca16dc90..386d62172 100644 --- a/package.json +++ b/package.json @@ -328,6 +328,15 @@ "type": "string", "description": "Absolute path to a file containing environment variable definitions.", "default": "${workspaceRoot}/.env" + }, + "backend": { + "type": "string", + "enum": [ + "default", + "native", + "lldb" + ], + "description": "Backend used by delve. Only available in delve version 0.12.2 and above." } } } diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts index 5963e3554..042d47d52 100644 --- a/src/debugAdapter/goDebug.ts +++ b/src/debugAdapter/goDebug.ts @@ -140,6 +140,7 @@ interface LaunchRequestArguments extends DebugProtocol.LaunchRequestArguments { trace?: boolean|'verbose'; /** Optional path to .env file. */ envFile?: string; + backend?: string; } process.on('uncaughtException', (err: any) => { @@ -283,11 +284,13 @@ class Delve { if (launchArgs.init) { dlvArgs = dlvArgs.concat(['--init=' + launchArgs.init]); } + if (launchArgs.backend) { + dlvArgs = dlvArgs.concat(['--backend=' + launchArgs.backend]); + } if (launchArgs.args) { dlvArgs = dlvArgs.concat(['--', ...launchArgs.args]); } - this.debugProcess = spawn(dlv, dlvArgs, { cwd: dlvCwd, env,