Skip to content

Commit b501de3

Browse files
hyangahgopherbot
authored andcommitted
Revert "docs: update the debugging doc about remote mode default adapter"
This reverts commit 5b0d6db. Reason for revert: Need to address path mapping issue: #3175 Change-Id: Iade1d9f2438993025ac1ef5ec9ad6f1213d79ed6 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/580019 kokoro-CI: kokoro <[email protected]> Commit-Queue: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Robert Findley <[email protected]> Auto-Submit: Hyang-Ah Hana Kim <[email protected]>
1 parent 9330b08 commit b501de3

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

docs/debugging-legacy.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The Go extension historically used a small adapter program to work with the Go debugger, [Delve].
44
The extension transitioned to communicate with [Delve] directly but there are still cases you may
5-
need to use the legacy debug adapter. This document explains how to use the
5+
need to use the legacy debug adapter (e.g. remote debugging). This document explains how to use the
66
***legacy*** debug adapter.
77

88

@@ -45,6 +45,8 @@ To opt in to use the legacy debug adapter (`legacy`) by default, add the followi
4545
```
4646

4747
If you want to use the legacy mode for only a subset of your launch configurations, you can use [the `debugAdapter` attribute](#launchjson-attributes) to switch between `"dlv-dap"` and `"legacy"` mode.
48+
For [Remote Debugging](#remote-debugging) (launch configuration with `"mode": "remote"` attribute),
49+
the extension will use the `"legacy"` mode by default, so setting this attribute won't be necessary.
4850

4951
Throughout this document, we assume that you opted in to use the legacy debug adapter.
5052
For debugging using the new debug adapter (default, `"dlv-dap"` mode), please see the documentation about [Debugging](https://github.com/golang/vscode-go/tree/master/docs/debugging-legacy.md).

docs/debugging.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,26 @@ activities using
66
[VS Code’s Debugging UI](https://code.visualstudio.com/docs/editor/debugging).
77

88
These debugging features are possible by using
9-
[Delve](https://github.com/go-delve/delve), the Go debugger, and its
10-
[native debug adapter implementation](https://github.com/go-delve/delve/tree/master/service/dap).
9+
[Delve](https://github.com/go-delve/delve), the Go debugger.
10+
11+
Previously, the Go extension communicated with Delve through a custom debug
12+
adaptor program (`legacy` mode). Since
13+
[`Delve`'s native debug adapter implementation](https://github.com/go-delve/delve/tree/master/service/dap)
14+
is available, the Go extension is transitioning to deprecate the legacy debug
15+
adapter in favor of direct communication with Delve via
16+
[DAP](https://microsoft.github.io/debug-adapter-protocol/overview).
17+
18+
19+
📣 **We are happy to announce that the new _`dlv-dap`_ mode of Delve
20+
integration is enabled for _local_ _debugging_ by default. For
21+
[_remote_ _debugging_](#remote-debugging) it is the default in
22+
[Go Nightly](nightly.md) and is available with stable builds on demand with
23+
`"debugAdapter": "dlv-dap"` attribute in `launch.json` or `settings.json`!**
24+
25+
Many features and settings described in this document may be available only with
26+
the new `dlv-dap` mode. For troubleshooting and configuring the legacy debug
27+
adapter, see
28+
[the legacy debug adapter documentation](https://github.com/golang/vscode-go/tree/master/docs/debugging-legacy.md).
1129

1230
## Get started
1331

@@ -64,9 +82,7 @@ from the tree head.
6482

6583
### Switch to legacy debug adapter
6684

67-
Previously, the Go extension communicated with Delve through a custom debug
68-
adaptor program (aka `legacy` mode). This legacy adapter is no longer maintained
69-
and will be removed by the end of 2024 H2.
85+
Note: The extension still uses the legacy debug adapter for remote debugging.
7086

7187
If you need to use the legacy debug adapter for local debugging (`legacy` mode)
7288
by default, add the following in your VSCode settings.
@@ -77,6 +93,9 @@ by default, add the following in your VSCode settings.
7793
}
7894
```
7995

96+
When `mode` is set to `remote` you must explicitly set `debugAdapter` to
97+
`dlv-dap` to override the legacy adapter default.
98+
8099
If you want to switch to `legacy` for only a subset of your launch
81100
configurations, you can use
82101
[the `debugAdapter` attribute](#launchjson-attributes) to switch between
@@ -790,8 +809,8 @@ with a running target.
790809

791810
The
792811
[headless dlv server](https://github.com/go-delve/delve/tree/master/Documentation/api)
793-
can now be used with both `"debugAdapter": "dlv-dap"` (default) and
794-
`"debugAdapter": "legacy"` (with Delve v1.7.3 or newer) as well as Delve's
812+
can now be used with both `"debugAdapter": "legacy"` (default value) and
813+
`"debugAdapter": "dlv-dap"` (with Delve v1.7.3 or newer) as well as Delve's
795814
[command-line interface](https://github.com/go-delve/delve/tree/master/Documentation/cli)
796815
via `dlv connect`. The `--accept-multiclient` flag makes this a multi-use server
797816
that persists on `Disconnect` from a client and allows repeated connections from
@@ -818,6 +837,7 @@ Connect to it with a remote attach configuration in your `launch.json`:
818837
{
819838
"name": "Connect to external session",
820839
"type": "go",
840+
"debugAdapter": "dlv-dap", // `legacy` by default
821841
"request": "attach",
822842
"mode": "remote",
823843
"port": 12345,

0 commit comments

Comments
 (0)