[vscode-go] package.json: configure the debug adapter from launch.json

6 views
Skip to first unread message

Suzy Mueller (Gerrit)

unread,
Feb 25, 2021, 6:27:29 PM2/25/21
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Hyang-Ah Hana Kim, kokoro, golang-co...@googlegroups.com

Suzy Mueller submitted this change.

View Change

Approvals: Hyang-Ah Hana Kim: Looks good to me, approved Suzy Mueller: Trusted; Run TryBots kokoro: TryBots succeeded
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 <suz...@golang.org>
Run-TryBot: Suzy Mueller <suz...@golang.org>
TryBot-Result: kokoro <noreply...@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hya...@gmail.com>
---
M docs/settings.md
M package.json
M src/goDebugFactory.ts
3 files changed, 17 insertions(+), 13 deletions(-)

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.

To view, visit change 295970. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: vscode-go
Gerrit-Branch: master
Gerrit-Change-Id: I4823482750623dadf1c90d501143a9a8aedc4d7b
Gerrit-Change-Number: 295970
Gerrit-PatchSet: 2
Gerrit-Owner: Suzy Mueller <suz...@golang.org>
Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
Gerrit-Reviewer: kokoro <noreply...@google.com>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages