Skip to content

Commit 5ea5456

Browse files
committed
[release] prepare v0.26.0 release
1bc09d8 src/goDebugConfiguration: resolve relative paths used in cwd, output, program ac7b209 package-lock.json: npm audit fix 4574878 package.json: pick up [email protected] settings and update tools version 7ea6b76 src/goDebugConfiguration: default to dlv-dap in preview mode e7e25d2 Revert ".github/workflows: use 'stable' version for release-nightly" 570a0a4 src/goModules.ts: open go.mod after init 936ecdf .github/workflows: use 'stable' version for release-nightly a1d1329 src/goImport: use gopls methods to list and add contextual imports 03a8315 src/goDebugFactory.ts: fix problem with attach requests 82d2b5d src/goTest: Add command Test Function At Cursor or Test Previous 505ad8d build/all.bash: use go install for tool installation e7c91ef package-lock.json: npm audit fix 616928d .github/workflows: use tmp dir as working dir when installing tools ab4f21a src/goDebugConfiguration: let vscode resolve pick process ecf30b7 src/goLanguageServer: migrate opt-out survey to Qualtrics 4cb78f6 src/goLint: handle the case where no editor is active c5070dc CHANGELOG.md: v0.25.1 updates b79bdf9 test/integration/goDebug.test.ts: include the debugger logging in tests 9b2b1ef src/goToolsInformation: update dlv-dap version d88ee9b src/goDebugFactory: respond with error if dlv dap failed to start fe7b40b src/goEnvironmentStatus: avoid TypeError for notification closed without action f22b65a src/goLint: fix type error caused by a bug in goLint b6a3630 src/goDebugFactory: connect after createDebugAdapterDescriptor cbdd328 src/goSurvey: double survey probability and send half to v2 survey 4510773 src/goSurvey: increase the prompt probability to 0.03 ad1dcce test/integration/goDebug.test.ts: accept 'exception' as stopped reason c54f5e6 package.json: set virtualWorkspaces capability to false 9fa871b src/goMain: warn users if go.goroot is set 0f4b38f tools/generate.go: update gopls and dlv-dap versions in generate 39445e1 src/goDebugConfiguration: use fileWorkspaceFolder in multi root workspace 961ab1c src/goLogging: fix the default logger 646faec package.json: use the updated workspace trust API e8dc6c4 package.json: remove 'init' debug attribute b9f1961 [release] Update CHANGELOG 64592bc src/debugAdapter: default path separator to '/' a2c2efc package.json: bump dev version number to 0.26.0-dev 7340877 [release] Update CHANGELOG for v0.25.0 4bae281 src/goDebugConfiguration.ts: add substitutePath to go.delveConfig d9fd8f0 docs: update dlv-dap.md cea0269 test/integration/goDebug: wait for debug adapter dispose in teardown test 41c5ee9 test/integration/goDebug.test.ts: use dc.on to wait for output event 50efa73 test/integration/goDebug: modify teardown+cleanup test 8803f91 docs: update outdated lint tool documentation in features.md 6571316 .github/workflows: move dlv to dlv-dap before getting dlv again 54986cd docs/settings.md: update gopls settings Change-Id: I6df1e8bbd836573b243fa9f290a149bc56d985a3
2 parents 9df2026 + f3b52e4 commit 5ea5456

34 files changed

+1402
-609
lines changed

.github/workflows/release-nightly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup Go
3030
uses: actions/setup-go@v2
3131
with:
32-
go-version: '1.15'
32+
go-version: '1.16'
3333

3434
- name: Install dependencies
3535
run: npm ci
@@ -66,6 +66,7 @@ jobs:
6666
go get github.com/go-delve/delve/cmd/dlv@master
6767
cp "${HOME}/go/bin/dlv${{env.EXT}}" "${HOME}/go/bin/dlv-dap${{env.EXT}}"
6868
go get github.com/go-delve/delve/cmd/dlv
69+
working-directory: ${{ runner.temp }}
6970
env:
7071
GO111MODULE: on
7172
EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ jobs:
5959
go get github.com/cweill/gotests/...
6060
go get github.com/rogpeppe/godef
6161
go get github.com/ramya-rao-a/go-outline
62+
# Install two versions of dlv (one as dlv-dap)
6263
go get github.com/go-delve/delve/cmd/dlv@master
63-
cp "${HOME}/go/bin/dlv${{env.EXT}}" "${HOME}/go/bin/dlv-dap${{env.EXT}}"
64-
go get github.com/go-delve/delve/cmd/dlv
64+
mv "${HOME}/go/bin/dlv${{env.EXT}}" "${HOME}/go/bin/dlv-dap${{env.EXT}}"
65+
go get github.com/go-delve/delve/cmd/dlv@latest
66+
working-directory: ${{ runner.temp }}
6567
env:
6668
GO111MODULE: on
6769
EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}"

.github/workflows/test-long.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
- name: Compile
4040
run: npm run vscode:prepublish
4141

42+
# TODO: use `go install` when we all move to 1.16+ (see build/all.bash)
4243
- name: Install Go tools (Modules mode)
4344
run: |
4445
go version
@@ -58,9 +59,11 @@ jobs:
5859
go get github.com/cweill/gotests/...
5960
go get github.com/rogpeppe/godef
6061
go get github.com/ramya-rao-a/go-outline
62+
# Install two versions of dlv (one as dlv-dap)
6163
go get github.com/go-delve/delve/cmd/dlv@master
62-
cp "${HOME}/go/bin/dlv${{env.EXT}}" "${HOME}/go/bin/dlv-dap${{env.EXT}}"
63-
go get github.com/go-delve/delve/cmd/dlv
64+
mv "${HOME}/go/bin/dlv${{env.EXT}}" "${HOME}/go/bin/dlv-dap${{env.EXT}}"
65+
go get github.com/go-delve/delve/cmd/dlv@latest
66+
working-directory: ${{ runner.temp }}
6467
env:
6568
GO111MODULE: on
6669
EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}"

.github/workflows/test-smoke.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ jobs:
5656
go get github.com/cweill/gotests/...
5757
go get github.com/rogpeppe/godef
5858
go get github.com/ramya-rao-a/go-outline
59+
# Install two versions of dlv (one as dlv-dap)
5960
go get github.com/go-delve/delve/cmd/dlv@master
60-
cp "${HOME}/go/bin/dlv${{env.EXT}}" "${HOME}/go/bin/dlv-dap${{env.EXT}}"
61-
go get github.com/go-delve/delve/cmd/dlv
61+
mv "${HOME}/go/bin/dlv${{env.EXT}}" "${HOME}/go/bin/dlv-dap${{env.EXT}}"
62+
go get github.com/go-delve/delve/cmd/dlv@latest
63+
working-directory: ${{ runner.temp }}
6264
env:
6365
GO111MODULE: on
6466
EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}"

build/all.bash

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,26 +99,27 @@ install_dependencies() {
9999
local TARGET="${GOBIN}"
100100
if [[ -z "${GOBIN}" ]]; then TARGET="${GOPATHS%%:*}/bin" ; fi
101101

102-
GO111MODULE=on go get golang.org/x/tools/gopls
103-
GO111MODULE=on go get github.com/acroca/go-symbols
104-
GO111MODULE=on go get github.com/cweill/gotests/...
105-
GO111MODULE=on go get github.com/davidrjenni/reftools/cmd/fillstruct
106-
GO111MODULE=on go get github.com/haya14busa/goplay/cmd/goplay
102+
GO111MODULE=on go install golang.org/x/tools/gopls@latest
103+
GO111MODULE=on go install github.com/acroca/go-symbols@latest
104+
GO111MODULE=on go install github.com/cweill/gotests/gotests@latest
105+
GO111MODULE=on go install github.com/davidrjenni/reftools/cmd/fillstruct@latest
106+
GO111MODULE=on go install github.com/haya14busa/goplay/cmd/goplay@latest
107107

108108
# We install two versions of gocode, one for module mode (gocode-gomod)
109109
# and another for GOPATH mode (gocode).
110-
GO111MODULE=on go get github.com/stamblerre/gocode && mv "${TARGET}/gocode" "${TARGET}/gocode-gomod"
111-
GO111MODULE=on go get github.com/mdempsky/gocode
112-
113-
GO111MODULE=on go get github.com/ramya-rao-a/go-outline
114-
GO111MODULE=on go get github.com/rogpeppe/godef
115-
GO111MODULE=on go get github.com/sqs/goreturns
116-
GO111MODULE=on go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
117-
GO111MODULE=on go get github.com/zmb3/gogetdoc
118-
GO111MODULE=on go get honnef.co/go/tools/...
119-
GO111MODULE=on go get golang.org/x/tools/cmd/gorename
120-
121-
GO111MODULE=on go get github.com/go-delve/delve/cmd/dlv@master && cp "${TARGET}/dlv" "${TARGET}/dlv-dap"
110+
GO111MODULE=on go install github.com/stamblerre/gocode@latest && mv "${TARGET}/gocode" "${TARGET}/gocode-gomod"
111+
GO111MODULE=on go install github.com/mdempsky/gocode@latest
112+
113+
GO111MODULE=on go install github.com/ramya-rao-a/go-outline@latest
114+
GO111MODULE=on go install github.com/rogpeppe/godef@latest
115+
GO111MODULE=on go install github.com/sqs/goreturns@latest
116+
GO111MODULE=on go install github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest
117+
GO111MODULE=on go install github.com/zmb3/gogetdoc@latest
118+
GO111MODULE=on go install honnef.co/go/tools/cmd/staticcheck@latest
119+
GO111MODULE=on go install golang.org/x/tools/cmd/gorename@latest
120+
121+
GO111MODULE=on go install github.com/go-delve/delve/cmd/dlv@master && cp "${TARGET}/dlv" "${TARGET}/dlv-dap"
122+
GO111MODULE=on go install github.com/go-delve/delve/cmd/dlv@latest
122123
}
123124

124125
main() {

docs/commands.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ List all the Go tools being used by this extension along with their locations.
3535

3636
Runs a unit test at the cursor.
3737

38+
### `Go: Test Function At Cursor or Test Previous`
39+
40+
Runs a unit test at the cursor if one is found, otherwise re-runs the last executed test.
41+
3842
### `Go: Subtest At Cursor`
3943

4044
Runs a sub test at the cursor.

docs/debugging.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ You may not need to configure any settings to start debugging your programs, but
7070
* `maxVariableRecurse`: How far to recurse when evaluating nested types (default: `1`).
7171
* `followPointers`: Automatically dereference pointers (default: `true`).
7272
* `showGlobalVariables`: Show global variables in the Debug view (default: `false`).
73+
* `debugAdapter`: Controls which debug adapter to use (default: `legacy`).
74+
* `substitutePath`: Path mappings to apply to get from a path in the editor to a path in the compiled program (default: `[]`).
7375

7476
There are some common cases when you might want to tweak the Delve configurations.
7577

@@ -113,10 +115,10 @@ showLog | If `true` and `logDest` is not set, Delve logs will be printed in t
113115
logOutput | Comma-separated list of Delve components (`debugger`, `gdbwire`, `lldbout`, `debuglineerr`, `rpc`) that should produce debug output when `showLog` is `true`. This corresponds to `dlv`'s `--log-output` flag.
114116
logDest | Absolute path to the delve log output file. This corresponds to `dlv`'s `--log-dest` flag, but number (used for file descriptor) is disallowed. Supported only in dlv-dap mode on Linux and Mac.
115117
buildFlags | Build flags to pass to the Go compiler. This corresponds to `dlv`'s `--build-flags` flag.
116-
dlvFlags | Extra flags passed to `dlv`. See `dlv help` for the full list of supported flags. This is useful when users need to pass less commonly used or new flags such as `--only-same-user`, `--check-go-version`. Note that some flags such as `--log-output`, `--log`, `--log-dest`, `--init`, `--api-version` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.
118+
dlvFlags | Extra flags passed to `dlv`. See `dlv help` for the full list of supported flags. This is useful when users need to pass less commonly used or new flags such as `--only-same-user`, `--check-go-version`. Note that some flags such as `--log-output`, `--log`, `--log-dest`, `--api-version` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.
117119
remotePath | If remote debugging (`mode`: `remote`), this should be the absolute path to the package being debugged on the remote machine. See the section on [Remote Debugging](#remote-debugging) for further details. [golang/vscode-go#45](https://github.com/golang/vscode-go/issues/45) is also relevant. Becomes the first mapping in substitutePath.
118120
substitutePath | An array of mappings from an absolute local path to an absolute remote path that is used by the debuggee. The debug adapter will replace the local path with the remote path in all of the calls. The mappings are applied in order, and the first matching mapping is used. This can be used to map files that have moved since the program was built, different remote paths, and symlinked files or directories. This is intended to be equivalent to the [substitute-path](https://github.com/go-delve/delve/tree/master/Documentation/cli#config) configuration, and will eventually configure substitute-path in Delve directly.
119-
cwd | The working directory to be used in running the program. If remote debugging (`mode`: `remote`), this should be the absolute path to the working directory being debugged on the local machine. See the section on [Remote Debugging](#remote-debugging) for further details. [golang/vscode-go#45](https://github.com/golang/vscode-go/issues/45) is also relevant.
121+
cwd | The working directory to be used in running the program. If remote debugging (`mode`: `remote`), this should be the absolute path to the working directory being debugged on the local machine. The extension defaults to the workspace folder, or the workspace folder of the open file in multi root workspaces. See the section on [Remote Debugging](#remote-debugging) for further details. [golang/vscode-go#45](https://github.com/golang/vscode-go/issues/45) is also relevant.
120122
processId | This is the process ID of the executable you want to debug. Applicable only when using the `attach` request in `local` mode. By setting this to the command name of the process, `${command:pickProcess}`, or`${command:pickGoProcess}` a quick pick menu will show a list of processes to choose from.
121123

122124
### Specifying [build tags](https://golang.org/pkg/go/build/#hdr-Build_Constraints)
@@ -161,7 +163,8 @@ Note that it is not recommended to debug optimized executables as Delve may not
161163

162164
Any property in the launch configuration that requires a file path can be specified in terms of [VS Code variables]. Here are some useful ones to know:
163165

164-
* `${workspaceFolder}` refers to the root of the workspace opened in VS Code.
166+
* `${workspaceFolder}` refers to the root of the workspace opened in VS Code. If using a multi root workspace, you must specify the folder name `${workspaceFolder:folderName}`
167+
* `${fileWorkspaceFolder}` refers to the the current opened file's workspace folder.
165168
* `${file}` refers to the currently opened file.
166169
* `${fileDirname}` refers to the directory containing the currently opened file. This is typically also the name of the Go package containing this file, and as such, can be used to debug the currently opened package.
167170

@@ -454,4 +457,4 @@ This extension does not provide general support for debugging projects containin
454457
[Delve]: https://github.com/go-delve/delve
455458
[VS Code variables]: https://code.visualstudio.com/docs/editor/variables-reference
456459
[snippets]: https://code.visualstudio.com/docs/editor/userdefinedsnippets
457-
[Command Palette]: https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette
460+
[Command Palette]: https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette

docs/dlv-dap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ The logging will appear in the `Go Debug` output channel (Command Palette -> "Vi
135135
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.
136136

137137
```
138-
$ dlv-dap dap --listen=:12345 --log-output=dap
138+
$ dlv-dap dap --listen=:12345 --log --log-output=dap
139139
```
140140

141141
```json5

docs/features.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ The vet tool used is the one provided by the `go` command: [`go vet`](https://go
187187

188188
Much like vet errors, lint errors can also be shown on save. This behavior is configurable through the [`"go.lintOnSave"`](settings.md#go.lintOnSave) setting.
189189

190-
The default lint tool is the one provided by the `go` command: `go lint`. However, custom lint tools can be easily used instead by configuring the [`"go.lintTool"`](settings.md#go.lintTool) setting. [`staticcheck`], [`golangci-lint`], and [`revive`] are supported.
190+
The default lint tool is [`staticcheck`]. However, custom lint tools can be easily used instead by configuring the [`"go.lintTool"`](settings.md#go.lintTool) setting. [`golint`], [`golangci-lint`], and [`revive`] are also supported.
191191

192192
For a complete overview of linter options, see the [documentation for diagnostic tools](tools.md#diagnostics).
193193

@@ -221,5 +221,6 @@ Export your current file to the [Go Playground](https://play.golang.org) via the
221221

222222
[`gopls`]: gopls.md
223223
[`staticcheck`]: https://staticcheck.io/
224+
[`golint`]: https://pkg.go.dev/golang.org/x/lint/golint?tab=overview
224225
[`golangci-lint`]: https://golangci-lint.run/
225226
[`revive`]: https://github.com/mgechev/revive

docs/settings.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ Delve settings that applies to all debugging sessions. Debug configuration in th
146146
| `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"` |
147147
| `dlvLoadConfig` | LoadConfig describes to delve, how to load values from target's memory. Ignored by 'dlv-dap'. <br/> Default: ``` { <pre>"followPointers" : true,<br/>"maxArrayValues" : 64,<br/>"maxStringLen" : 64,<br/>"maxStructFields" : -1,<br/>"maxVariableRecurse" : 1,</pre>} ``` |
148148
| `showGlobalVariables` | Boolean value to indicate whether global package variables should be shown in the variables pane or not. <br/> Default: `false` |
149+
| `substitutePath` | An array of mappings from a local path to the remote path that is used by the debuggee. The debug adapter will replace the local path with the remote path in all of the calls. Overriden by remotePath. |
149150

150151
Default:
151152
```
@@ -160,6 +161,7 @@ Default:
160161
"maxVariableRecurse" : 1,
161162
},
162163
"showGlobalVariables" : false,
164+
"substitutePath" : [],
163165
}
164166
```
165167
### `go.disableConcurrentTests`
@@ -542,6 +544,13 @@ comprehensively test.
542544

543545

544546
Default: `true`
547+
### `build.experimentalTemplateSupport`
548+
549+
(Experimental) experimentalTemplateSupport opts into the experimental support
550+
for template files.
551+
552+
553+
Default: `false`
545554
### `build.experimentalWorkspaceModule`
546555

547556
(Experimental) experimentalWorkspaceModule opts a user into the experimental support
@@ -625,7 +634,7 @@ Default: `"100ms"`
625634
such as "someSlice.sort!".
626635

627636

628-
Default: `false`
637+
Default: `true`
629638
### `ui.completion.matcher`
630639

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

0 commit comments

Comments
 (0)