package.json: configure the debug adapter from launch.json
Use the launch configurations to specify which debug adapter to
use when debugging.
Change-Id: I4823482750623dadf1c90d501143a9a8aedc4d7b
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/295970
Trust: Suzy Mueller <suzmue@golang.org>
Run-TryBot: Suzy Mueller <suzmue@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
diff --git a/docs/settings.md b/docs/settings.md
index 496d30b..abde52b 100644
--- a/docs/settings.md
+++ b/docs/settings.md
@@ -438,11 +438,6 @@
Complete functions with their parameter signature, excluding the variable types. Use `gopls.usePlaceholders` when using the language server.
Default: `false`
-### `go.useDlvDap`
-
-Use the Go debug adapter implemented in "delve". This debug adapter is still experimental.
-
-Default: `false`
### `go.useGoProxyToCheckForToolUpdates (deprecated)`
Use `go.toolsManagement.checkForUpdates` instead.
diff --git a/package.json b/package.json
index 3768536..d0bb22f 100644
--- a/package.json
+++ b/package.json
@@ -513,6 +513,14 @@
"launch": {
"required": [],
"properties": {
+ "debugAdapter": {
+ "enum": [
+ "legacy",
+ "dlv-dap"
+ ],
+ "description": "Select which debug adapter to use with this launch configuration",
+ "default": "legacy"
+ },
"program": {
"type": "string",
"description": "Path to the program folder (or any file within that folder) when in 'debug' or 'test' mode, and to the pre-built binary file to debug in 'exec' mode.",
@@ -720,6 +728,14 @@
"attach": {
"required": [],
"properties": {
+ "debugAdapter": {
+ "enum": [
+ "legacy",
+ "dlv-dap"
+ ],
+ "description": "Select which debug adapter to use with this launch configuration",
+ "default": "legacy"
+ },
"processId": {
"anyOf": [
{
@@ -1662,11 +1678,6 @@
"description": "Folder names (not paths) to ignore while using Go to Symbol in Workspace feature. Not applicable when using the language server.",
"scope": "resource"
},
- "go.useDlvDap": {
- "type": "boolean",
- "default": false,
- "description": "Use the Go debug adapter implemented in \"delve\". This debug adapter is still experimental."
- },
"go.delveConfig": {
"type": "object",
"properties": {
diff --git a/src/goDebugFactory.ts b/src/goDebugFactory.ts
index b2964c0..b698f38 100644
--- a/src/goDebugFactory.ts
+++ b/src/goDebugFactory.ts
@@ -7,7 +7,6 @@
import { ChildProcess, ChildProcessWithoutNullStreams, spawn } from 'child_process';
import * as fs from 'fs';
import { DebugConfiguration } from 'vscode';
-import { getGoConfig } from './config';
import { logError, logInfo } from './goLogging';
import { envPath } from './utils/pathUtils';
import { killProcessTree } from './utils/processUtils';
@@ -22,8 +21,7 @@
session: vscode.DebugSession,
executable: vscode.DebugAdapterExecutable | undefined
): Promise<vscode.ProviderResult<vscode.DebugAdapterDescriptor>> {
- const config = getGoConfig();
- if (config['useDlvDap']) {
+ if (session.configuration.debugAdapter === 'dlv-dap') {
return this.createDebugAdapterDescriptorDlvDap(session.configuration);
}
// Terminate any running dlv dap server process.