Skip to content

Commit 1cacf9d

Browse files
committed
docs/dlv-dap: add the link to the list of dlv-dap only features
And rearrange to highlight 'getting started' step more. Added the tool installation popup screenshot. Change-Id: Icedc7dbc2ebf64550cee7716844519e315d64099 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/307609 Trust: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Polina Sokolova <[email protected]>
1 parent 66b684a commit 1cacf9d

File tree

2 files changed

+42
-23
lines changed

2 files changed

+42
-23
lines changed

docs/dlv-dap.md

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22

33
[`Delve`'s native DAP implementation](https://github.com/go-delve/delve/tree/master/service/dap) is now available to be used to debug Go programs.
44

5-
This debug adapter runs in a separate `go` process, which is spawned by VS Code when you debug Go code. Since `dlv dap` is under active development, we need the Delve built at master to get all recent updates. The Go extension currently maintains this unstable version of Delve separately from the stable version (`dlv`), and installs it as `dlv-dap`.
5+
_________________
6+
**🔥 This new adapter is still in active development, so to take advantage of the most recent features and bug fixes, you need to use Delve built from the dev branch. When the extension asks to install/update `dlv-dap`, please follow the instruction and rebuild the tool.**
7+
_________________
68

7-
Please see the [Debug Adapter Protocol (DAP)](https://microsoft.github.io/debug-adapter-protocol/) to understand how the Debug Adapter acts as an intermediary between VS Code and the debugger ([Delve](https://github.com/go-delve/delve)).
9+
The Go extension currently maintains this development version of Delve separately from the stable version of `dlv`. This version is installed with the name `dlv-dap`. Please follow the instruction in [Getting Started](#getting-started) to configure the extension and install `dlv-dap`.
810

9-
Follow along with [golang/vscode-go#23](https://github.com/golang/vscode-go/issues/23) and the [project dashboard](https://github.com/golang/vscode-go/projects/3) for updates on the implementation.
10-
11-
## Overview
11+
This new debug adapter runs in a separate `go` process, which is spawned by VS Code when you debug Go code.
12+
Please see the [Debug Adapter Protocol (DAP)](https://microsoft.github.io/debug-adapter-protocol/) to learn about how the Debug Adapter acts as an intermediary between VS Code and the debugger ([Delve](https://github.com/go-delve/delve)).
1213

13-
* [How to use dlv dap](#how-to-use-dlv-dap)
14-
* [Features & Caveats](#features-and-caveats)
15-
* [Reporting issues](#reporting-issues)
16-
* [How to contribute](#developing)
1714

18-
## How to use dlv dap
15+
## Getting Started
1916

20-
You can choose which debug adapter to use with the `"debugAdapter"` field in [your `launch.json` configuration](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#snippets). Most settings will continue to work with in `"dlv-dap" debugAdapter` mode except [a few caveats](#features-and-caveats).
17+
You can choose which debug adapter to use with the `"debugAdapter"` field in [your `launch.json` configuration](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#snippets). Most settings will continue to work with in this new `"dlv-dap"` mode except [a few caveats](#features-and-caveats).
2118
If you do not already have a `launch.json`, select `create a launch.json file` from the debug pane and choose an initial Go debug configuration.
2219

23-
<div style="text-align: center;"><img src="images/createlaunchjson.png" alt="The debug pane with the option to create launch.json"> </div>
20+
<div style="text-align: center;"><img src="images/createlaunchjson.png" width=200 alt="The debug pane with the option to create launch.json"> </div>
2421

2522
In your launch configuration, set the `"debugAdapter"` field to be `"dlv-dap"`. For example, a launch configuration for a file would look like:
2623

@@ -30,13 +27,19 @@ In your launch configuration, set the `"debugAdapter"` field to be `"dlv-dap"`.
3027
"type": "go",
3128
"request": "launch",
3229
"mode": "auto",
33-
"program": "${file}",
30+
"program": "${fileDirname}",
3431
"debugAdapter": "dlv-dap"
3532
}
3633
```
3734

3835
To switch back to the legacy adapter, set `"debugAdapter"` to `"legacy"`.
3936

37+
When you start debugging using the configuration for the first time, the extension will ask you to install `dlv-dap`.
38+
39+
<div style="text-align: center;"><img src="images/dlv-dap-install-prompt.gif" width=350 alt="missing tool notification"> </div>
40+
41+
Once `dlv-dap` is installed, the extension will prompt you for update whenever installing a newer version is necessary (usually after the Go extension update).
42+
4043
### Updating dlv dap
4144
The easiest way is to use the `"Go: Install/Update Tools"` command from the command palette (⇧+⌘+P or Ctrl+Shift+P). The command will show `dlv-dap` in the tool list. Select it, and the extension will build the tool at master.
4245

@@ -48,28 +51,45 @@ $ mv /tmp/dlv $GOPATH/bin/dlv-dap
4851
```
4952

5053
## Features and Caveats
54+
<!-- TODO: update the debugging section of features.md using dlv-dap mode -->
55+
56+
🎉 The new debug adapter offers many improvements and fixes bugs that existed in the old adapter. [Here](https://github.com/golang/vscode-go/issues?q=is%3Aissue+label%3Afixedindlvdaponly) is a partial list of enhancement/fixes available only in the new adapter.
57+
58+
* User-friendly inlined presentation of variables of all complex types (map, struct, pointer, array, slice, ...)
59+
* Fixed handling of maps with compound keys
60+
* Improved CALL STACK presentation
61+
* Fixed automated "Add to Watch" / "Copy as Expression" expressions.
62+
* Support to switch goroutines while stepping.
63+
* Robust `call` evaluation.
64+
* Good test coverage.
5165

52-
Dlv DAP implementation offers the following advantages:
53-
* Better map key presentation. ([Issue 1267](https://github.com/golang/vscode-go/issues/1267#issuecomment-800607474))
54-
<!-- TODO(polinasok,suzmue): add more unique features -->
5566

56-
The following features are still under development.
67+
Most of all, the new adapter is written in Go and integrated in `dlv`. That will make it easier for the Go community to contribute. </br>
68+
Because it is native, we hope for improvement in speed and reliability.
5769

58-
* Stop/pause/restart while the debugged program is running does not work.
70+
⚒️ The following features are still under development.
71+
72+
* Stop/pause/restart while the debugged program is running does not work yet.
5973
* Cannot be used with `debug test` codelens.
6074
* Support for `"dlvFlags"` attributes in launch configuration is not available.
6175
* `dlvLoadConfig` to configure max string/bytes length in [`"go.delveConfig"`](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#configuration) does not work.
6276
* [Remote debugging](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#remote-debugging) is not supported.
6377

78+
Follow along with [golang/vscode-go#23](https://github.com/golang/vscode-go/issues/23) and the [project dashboard](https://github.com/golang/vscode-go/projects/3) for updates on the implementation.
79+
6480
## Reporting issues
6581

66-
The VS Code Go maintainers are reachable via the issue tracker and the #vscode-dev channel in the Gophers Slack. Please reach out on Slack with questions, suggestions, or ideas. If you have trouble getting started on an issue, we'd be happy to give pointers and advice.
82+
The VS Code Go maintainers are reachable via the issue tracker and the #vscode-dev channel in the Gophers Slack. </br>
83+
Please reach out on Slack with questions, suggestions, or ideas. If you have trouble getting started on an issue, we'd be happy to give pointers and advice.
84+
85+
When you are having issues in `dlv-dap` mode, first check if the problems are reproducible after updating `dlv-dap`. It's possible that the issues are already fixed. Follow the instruction for [updating dlv-dap](#updating-dlv-dap)) and [updating extension](https://code.visualstudio.com/docs/editor/extension-gallery#_extension-autoupdate).
6786

6887
Please report issues in [our issue tracker](https://github.com/golang/vscode-go/issues) with the following information.
6988

7089
* `go version`
7190
* `go version -m dlv-dap`
72-
* Instruction to reproduce the issue (code snippets, `launch.json`, screenshot)
91+
* VS Code and VS Code Go version.
92+
* Instruction to reproduce the issue (code snippets, your `launch.json`, screenshot)
7393

7494
## Developing
7595

@@ -91,11 +111,10 @@ Set `logOutput` and `showLog` attributes in `launch.json` to enable logging and
91111
{
92112
"name": "Launch file",
93113
"type": "go",
94-
"request": "launch",
95114
"debugAdapter": "dlv-dap",
96115
"showLog": true,
116+
"logOutput": "dap",
97117
...
98-
"logOutput": "dap"
99118
}
100119
```
101120

@@ -114,4 +133,4 @@ $ dlv-dap dap --listen=:12345 --log-output=dap
114133
...
115134
"port": 12345
116135
}
117-
```
136+
```
16.3 KB
Loading

0 commit comments

Comments
 (0)