Skip to content

Commit 6c0bda2

Browse files
committed
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 <[email protected]> Run-TryBot: Suzy Mueller <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
1 parent 481ae47 commit 6c0bda2

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

docs/settings.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,6 @@ Default: `false`
437437

438438
Complete functions with their parameter signature, excluding the variable types. Use `gopls.usePlaceholders` when using the language server.
439439

440-
Default: `false`
441-
### `go.useDlvDap`
442-
443-
Use the Go debug adapter implemented in "delve". This debug adapter is still experimental.
444-
445440
Default: `false`
446441
### `go.useGoProxyToCheckForToolUpdates (deprecated)`
447442

package.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,14 @@
513513
"launch": {
514514
"required": [],
515515
"properties": {
516+
"debugAdapter": {
517+
"enum": [
518+
"legacy",
519+
"dlv-dap"
520+
],
521+
"description": "Select which debug adapter to use with this launch configuration",
522+
"default": "legacy"
523+
},
516524
"program": {
517525
"type": "string",
518526
"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 @@
720728
"attach": {
721729
"required": [],
722730
"properties": {
731+
"debugAdapter": {
732+
"enum": [
733+
"legacy",
734+
"dlv-dap"
735+
],
736+
"description": "Select which debug adapter to use with this launch configuration",
737+
"default": "legacy"
738+
},
723739
"processId": {
724740
"anyOf": [
725741
{
@@ -1662,11 +1678,6 @@
16621678
"description": "Folder names (not paths) to ignore while using Go to Symbol in Workspace feature. Not applicable when using the language server.",
16631679
"scope": "resource"
16641680
},
1665-
"go.useDlvDap": {
1666-
"type": "boolean",
1667-
"default": false,
1668-
"description": "Use the Go debug adapter implemented in \"delve\". This debug adapter is still experimental."
1669-
},
16701681
"go.delveConfig": {
16711682
"type": "object",
16721683
"properties": {

src/goDebugFactory.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import { ChildProcess, ChildProcessWithoutNullStreams, spawn } from 'child_process';
88
import * as fs from 'fs';
99
import { DebugConfiguration } from 'vscode';
10-
import { getGoConfig } from './config';
1110
import { logError, logInfo } from './goLogging';
1211
import { envPath } from './utils/pathUtils';
1312
import { killProcessTree } from './utils/processUtils';
@@ -22,8 +21,7 @@ export class GoDebugAdapterDescriptorFactory implements vscode.DebugAdapterDescr
2221
session: vscode.DebugSession,
2322
executable: vscode.DebugAdapterExecutable | undefined
2423
): Promise<vscode.ProviderResult<vscode.DebugAdapterDescriptor>> {
25-
const config = getGoConfig();
26-
if (config['useDlvDap']) {
24+
if (session.configuration.debugAdapter === 'dlv-dap') {
2725
return this.createDebugAdapterDescriptorDlvDap(session.configuration);
2826
}
2927
// Terminate any running dlv dap server process.

0 commit comments

Comments
 (0)