Skip to content

Commit bb9b57c

Browse files
committed
[release] prepare v0.24.1 release
ec040a9 .github/release_plan.md: add a template for the release plan ce52d04 src/goTools: update dlv-dap latest version 18e3636 package.json: sync gopls settings to match v0.6.10 4948401 src/goDebugFactory.ts: send terminated event on server start error 6f9c0eb docs/dlv-dap.md: include go.delveConfig setting for debugAdapter 337ae93 src/testUtils: tighten test function detection regex bded07b src/goDebugConfiguration.ts: clean up launch.json quickpick c189ec0 src/goTest.ts: allow users to select default debug adapter d5c8951 test/integration/goDebug: enable noDebug tests for dlv dap 44b7d36 src/goDebugConfiguration: clean up launch config snippets d6e513e src/goDebugFactory.ts: fix output event destination 1d549a2 src/goInstallTools: linkify dlv-dap installation instruction 1cacf9d docs/dlv-dap: add the link to the list of dlv-dap only features 66b684a test/integration/goDebug.test.ts: add test for runtime error 25d2981 CHANGELOG.md: for v0.24.0 d7f3a5a package.json/package-lock.json: update dev version 505f363 src/goTools: update latest version of dlv-dap 8e70c58 src/goInstallTools.ts: update install instructions for dlv-dap 33339e6 test/integration/goDebug.test.ts: remove '.only' from test d1ca321 test/integration/goDebug.test.ts: enable switch goroutine test dap d9fca4d src/goInstallTools: remove dlv-dap from missing tools f56b715 src/goDebugFactory: output dlv dap command as console output event 471ed7e test/integration: use DelveDAPOutputAdapter in dlv-dap mode testing f8f5433 src/goDebugFactory: wait before killing the spawned dap server e545b83 test/integration: disable broken tests afbc36c .github/workflows: correct lint check condition 42de993 docs/dlv-dap: update installation instruction Change-Id: I0ad0961a4980471cd2d20cb1c5d959a06f612ef8
2 parents cffd213 + ec040a9 commit bb9b57c

22 files changed

+617
-223
lines changed

.github/release_plan.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Release candidate (DATE)
2+
3+
- [ ] Announce the release, leave enough time for teams to surface any last minute issues that need to get in before freeze. Make sure debugger and gopls teams are looped in as well.
4+
- [ ] Create a milestone with the issues that are fixed by this release
5+
- [ ] Update `master` for the release
6+
- [ ] Update hardcoded latest version for `dlv-dap` and `gopls`
7+
- [ ] Update `release` for the release
8+
- [ ] Create a branch against `release` for a pull request
9+
- [ ] Merge changes from `master` to prepare for the release
10+
- [ ] Change the version in [`package.json`](https://github.com/golang/vscode-go/blob/master/package.json) from a `-dev` suffix
11+
- [ ] Run `npm install` to make sure [`package-lock.json`](https://github.com/golang/vscode-go/blob/master/package.json) is up-to-date
12+
- [ ] Update the license file (`$ tools/license.sh; mv LICENSE.prod LICENSE`)
13+
- [ ] Update [`CHANGELOG.md`](https://github.com/golang/vscode-go/blob/master/CHANGELOG.md)
14+
- [ ] Make sure the "Thanks" section is up-to-date
15+
- [ ] Check the Markdown rendering to make sure everything looks good
16+
- [ ] Check the [Long Tests status](https://github.com/golang/vscode-go/actions?query=workflow%3A%22Long+Tests%22) is green. Otherwise, fix the tests, send cls for review, submit them, and repeat.
17+
- [ ] Perform manual [smoke tests]( https://github.com/golang/vscode-go/blob/master/docs/smoke-test.md)
18+
- [ ] Create new version tag for X.XX.X-rc.1 at gerrit’s vscode-go [repo management page](https://go-review.googlesource.com/admin/repos/vscode-go,tags)
19+
- [ ] Go to the release page https://github.com/golang/vscode-go/releases and check if the new release candidate is up. If necessary, you can manually edit the comment by clicking the “Edit” button. Don’t mutate uploaded vsix.
20+
- [ ] Ask editor team and contributors to this release to test the release candidate
21+
22+
# Release Candidate >1 (if necessary)
23+
- ] Fix any bugs on `master` and cherry pick changes to `release
24+
- [ ] Create new version tag for X.XX.X-rc.1 at gerrit’s vscode-go [repo management page](https://go-review.googlesource.com/admin/repos/vscode-go,tags)
25+
- [ ] Go to the release page https://github.com/golang/vscode-go/releases and check if the new release candidate is up. If necessary, you can manually edit the comment by clicking the “Edit” button. Don’t mutate uploaded vsix.
26+
- [ ] Ask editor team and contributors to this release to test the release candidate
27+
28+
29+
# Final (DATE)
30+
- [ ] Tag the new release
31+
- [ ] Update the release description with CHANGELOG contents
32+
- [ ] Close the milestone
33+
34+
# Prepare for the Next Release
35+
- [ ] Update `master` post-release
36+
- [ ] Bump the version number to the next monthly ("X.XX.X-dev") release in the `master` branch
37+
- [ ] `package.json`
38+
- [ ] `package-lock.json`
39+
- [ ] Cherry pick CHANGELOG.md back to master

.github/workflows/test-long-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ jobs:
7979

8080
- name: Lint check
8181
run: npm run lint
82-
if: ${{ matrix.os }} == 'ubuntu-latest' && ${{ matrix.version }} == 'stable' && !contains(${{ matrix.go }}, "beta") && !contains(${{ matrix.go }}, "rc")
82+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 'stable' }}

.github/workflows/test-long.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ jobs:
7676

7777
- name: Lint check
7878
run: npm run lint
79-
if: ${{ matrix.os }} == 'ubuntu-latest'
79+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 'stable' }}

.github/workflows/test-smoke.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ jobs:
7474

7575
- name: Lint check
7676
run: npm run lint
77-
if: ${{ matrix.os }} == 'ubuntu-latest'
77+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 'stable' }}

docs/debugging.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This document explains how to debug your Go programs in VS Code. The Go debugger is [Delve]. You can read more about it in the [Delve documentation](https://github.com/go-delve/delve/tree/master/Documentation).
44

5+
📣 Integration with the [Delve's native DAP implementation](https://github.com/golang/vscode-go/tree/master/docs/dlv-dap.md) is available for preview. Please give it a try and provide feedback!
6+
57
## Overview
68

79
* [Set up](#set-up)
@@ -172,7 +174,7 @@ Below are the available sample configurations:
172174

173175
#### Debug the current file (`Go: Launch file`)
174176

175-
Recall that `${file}` refers to the currently opened file (see [Using VS Code Variables](#using-vs-code-variables)).
177+
Recall that `${file}` refers to the currently opened file (see [Using VS Code Variables](#using-vs-code-variables)). For debugging a package that consists with multiple files, use `${fileDirname}` instead.
176178

177179
```json5
178180
{
@@ -204,7 +206,8 @@ Recall that `${workspaceFolder}` refers to the current workspace (see [Using VS
204206

205207
#### Debug all tests in the given package (`Go: Launch test package`)
206208

207-
Recall that `${workspaceFolder}` refers to the current workspace (see [Using VS Code Variables](#using-vs-code-variables)).
209+
A package is a collection of source files in the same directory that are compiled together.
210+
Recall that `${fileDirname}` refers to the directory of the open file (see [Using VS Code Variables](#using-vs-code-variables)).
208211

209212
```json5
210213
{

docs/dlv-dap.md

Lines changed: 113 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,136 @@
1-
# Dlv DAP - Delve's native DAP implementationa
1+
# Dlv DAP - Delve's native DAP implementation
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 recommend that `dlv` be installed at master to get all recent updates.
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

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`.
10+
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)).
13+
14+
15+
## Getting Started
16+
17+
You can select the default debug adapter to use in all launch configurations and codelenses through the `"debugAdapter"` field in the [`"go.delveConfig"`](settings.md#go.delveConfig) setting. You can choose which debug adapter to use for individual launch configurations 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).
18+
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.
19+
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>
21+
22+
In your launch configuration, set the `"debugAdapter"` field to be `"dlv-dap"`. For example, a launch configuration for a file would look like:
23+
24+
```json5
25+
{
26+
"name": "Launch file",
27+
"type": "go",
28+
"request": "launch",
29+
"mode": "auto",
30+
"program": "${fileDirname}",
31+
"debugAdapter": "dlv-dap"
32+
}
733
```
8-
$ GO111MODULES=on go get github.com/go-delve/delve@master
34+
35+
To switch back to the legacy adapter, set `"debugAdapter"` to `"legacy"`.
36+
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+
43+
### Updating dlv dap
44+
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.
45+
46+
If you want to install it manually, `go get` with the following command and rename it to `dlv-dap`.
47+
948
```
49+
$ GO111MODULE=on GOBIN=/tmp/ go get github.com/go-delve/delve/cmd/dlv@master
50+
$ mv /tmp/dlv $GOPATH/bin/dlv-dap
51+
```
52+
53+
## 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.
1057

11-
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)).
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.
65+
66+
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.
69+
70+
⚒️ The following features are still under development.
71+
72+
* Stop/pause/restart while the debugged program is running does not work yet.
73+
* Cannot be used with `debug test` codelens.
74+
* Support for `"dlvFlags"` attributes in launch configuration is not available.
75+
* `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.
76+
* [Remote debugging](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#remote-debugging) is not supported.
1277

1378
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.
1479

15-
## Overview
80+
## Reporting issues
1681

17-
* [How to use dlv dap](#how-to-use-dlv-dap)
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.
1884

19-
## How to use dlv dap
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).
2086

21-
You can choose which debug adapter to use with the `"debugAdapter"` field in your launch configuration. 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.
87+
Please report issues in [our issue tracker](https://github.com/golang/vscode-go/issues) with the following information.
2288

23-
<div style="text-align: center;"><img src="images/createlaunchjson.png" alt="The debug pane with the option to create launch.json"> </div>
89+
* `go version`
90+
* `go version -m dlv-dap`
91+
* VS Code and VS Code Go version.
92+
* Instruction to reproduce the issue (code snippets, your `launch.json`, screenshot)
2493

25-
In your launch configuration, set the `"debugAdapter"` field to be `"dlv-dap"`. For example, a launch configuration for a file would look like:
94+
## Developing
95+
96+
### Code location
97+
The core part of Delve DAP implementation is in the [`service/dap`](https://github.com/go-delve/delve/tree/master/service/dap) package. Follow Delve project's [contribution guideline](https://github.com/go-delve/delve/blob/master/CONTRIBUTING.md#contributing-code) to send PRs.
98+
Code for integration with the Go extension is mostly in [`src/goDebugFactory.ts`](https://github.com/golang/vscode-go/blob/master/src/goDebugFactory.ts) and tests are in [`test/integration/goDebug.test.ts`](https://github.com/golang/vscode-go/blob/master/test/integration/goDebug.test.ts). Please take a look at VS Code Go project's [contribution guideline](https://github.com/golang/vscode-go/blob/master/docs/contributing.md) to learn about how to prepare a change and send it for review.
99+
100+
### Testing
101+
For simple launch cases, build the delve binary, and configure `"go.alternateTools"` setting.
26102

103+
```json5
104+
"go.alternateTools": {
105+
"dlv-dap": <path_to_your_delve>
106+
}
107+
```
108+
109+
Set `logOutput` and `showLog` attributes in `launch.json` to enable logging and DAP message tracing.
27110
```json5
28111
{
29112
"name": "Launch file",
30113
"type": "go",
31-
"request": "launch",
32-
"mode": "auto",
33-
"program": "${file}",
34-
"debugAdapter": "dlv-dap"
114+
"debugAdapter": "dlv-dap",
115+
"showLog": true,
116+
"logOutput": "dap",
117+
...
35118
}
36119
```
37120

38-
To switch back to the legacy adapter, set `"debugAdapter"` to `"legacy"`.
121+
If you are having issues with seeing logs and or suspect problems in extension's integration, you can start Delve DAP server from a separate terminal and configure the extension to directly connect to it.
122+
123+
```
124+
$ dlv-dap dap --listen=:12345 --log-output=dap
125+
```
126+
127+
```json5
128+
{
129+
"name": "Launch file",
130+
"type": "go",
131+
"request": "launch",
132+
"debugAdapter": "dlv-dap",
133+
...
134+
"port": 12345
135+
}
136+
```
16.3 KB
Loading

docs/settings.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@ Delve settings that applies to all debugging sessions. Debug configuration in th
143143
| Properties | Description |
144144
| --- | --- |
145145
| `apiVersion` | Delve Api Version to use. Default value is 2. <br/> Allowed Options: `1`, `2` <br/> Default: `2` |
146+
| `debugAdapter` | Select which debug adapter to use by default. This is also used for choosing which debug adapter to use when no launch.json is present and with codelenses. <br/> Allowed Options: `legacy`, `dlv-dap` <br/> Default: `"legacy"` |
146147
| `dlvLoadConfig` | LoadConfig describes to delve, how to load values from target's memory <br/> Default: ``` { <pre>"followPointers" : true,<br/>"maxArrayValues" : 64,<br/>"maxStringLen" : 64,<br/>"maxStructFields" : -1,<br/>"maxVariableRecurse" : 1,</pre>} ``` |
147148
| `showGlobalVariables` | Boolean value to indicate whether global package variables should be shown in the variables pane or not. <br/> Default: `false` |
148149

149150
Default:
150151
```
151152
{
152153
"apiVersion" : 2,
154+
"debugAdapter" : "legacy",
153155
"dlvLoadConfig" : {
154156
"followPointers" : true,
155157
"maxArrayValues" : 64,
@@ -598,6 +600,13 @@ results. Zero means unlimited.
598600

599601

600602
Default: `"100ms"`
603+
### `ui.completion.experimentalPostfixCompletions`
604+
605+
(Experimental) experimentalPostfixCompletions enables artifical method snippets
606+
such as "someSlice.sort!".
607+
608+
609+
Default: `false`
601610
### `ui.completion.matcher`
602611

603612
(Advanced) matcher sets the algorithm that is used when calculating completion

docs/tools.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ This extension uses Delve for its debug/test functionalities. The extension curr
3535

3636
For a comprehensive overview of how to debug your Go programs, please see the [debugging guide](./debugging.md).
3737

38+
### [`dlv-dap`](https://github.com/go-delve/delve)
39+
This extension requires an unstable version of [`dlv`](#dlv) when users opt in to use Delve's native DAP implementation. `dlv-dap` is a `dlv` built from the master, which includes unreleased features. Please see the documentation about [Dlv DAP - Delve's Native DAP implementation](./dlv-dap.md) for details.
3840

3941
### [`gopkgs`](https://pkg.go.dev/github.com/uudashr/gopkgs?tab=overview)
4042

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)