Skip to content

Commit e2e6b00

Browse files
committed
[release] prepare v0.18.0 release @9e91b75
9e91b75 test: extract helper function for checking variable value 59e1356 src/goMain: try both gc_details and gopls_gc_details 26d2a33 src/debugAdapter: indicate that conditional breakpoints are supported 8fc4183 src/goLanguageServer: enable survey for the go extension users 6703469 src/debugAdapter: revert cl/253578 d2fbb62 debugAdapter: Fix bugs that cause remote debug to hang c17c69f src/goModules: exclude vendor paths from inferGopath disable mechanism 0cdccf1 test: increase timeout for debug adapter tests 6a2a004 test: fix breakpoint tests on windows 7d5f58a test: add go directive to fixtures 9e6fac4 src/goInstallTools: prompt again after showing 'release notes' d57f263 test: adjust tests involving 'check*' when language server is on 560405b src/goInstallTools.ts: handle stderr of go env 8f08cfd src/goEnvironmentStatus.ts: allow to choose go from file browser 263c427 test: test the debug adapter on test launch configurations 51a4b3a test: disconnect from the debug adapter after each test 5b25666 package.json: upgrade vscode-languageclient to use 7.0.0-next.9 a587fea src/goMain.ts: call gc_details command through vscode API 0aea0bf CHANGELOG.md: cherry-pick v0.17.1/v0.17.2 CHANGELOG changes acf2483 src/util.ts: handle diagnostics errors for all visible files 0c3ec39 docs: improve documentation for debugging CLI applications 7e58c56 snippets: add a placeholder for the for loop index cfa00f0 test: add debug adapter tests ec96bd7 src/goStatus.ts: refactor status bar code into goStatus.ts b2692c9 src/debugAdapter: send terminated event when program exits 70f7a71 src/goLanguageServer.ts: enable language server by default in nightly 39c9a2e build/all.bash: install dependencies without -v 473c0fc vs-code tasks: missed comma in the snippet 89f5d4e goLanguageServer: send the gopls config as initialization options b6aeab4 goModules: set "go.useLanguageServer" to true if the user installs it 1b82f49 src/goEnvironmentStatus.ts: clear pre-installed terminal PATH mutation 9bf9d64 src/goInstallTools.ts: add GOROOT/bin to PATH when it wasn't found from PATH 50240bf LICENSE: restore LICENSE dbb38c5 goLanguageServer: correctly reflect modifications to the survey config 690469c src/goStatus.ts: consolidate Go status bar items 9ab1e77 src/goMain.ts: call listeners for active text editor on init a2c7402 goLanguageServer: add command to toggle gc_details ab4b257 src/goInstallTools.ts: mutate PATH only when necessary e0ce53b docs/debugging.md: document lack of symlink support c65170a docs/stdlib.md: clarify the change in the go.alternateTools section 8e9cae7 src/goInstallTools.ts: return a rejected promise when go isn't found 18cfe6e src/debugAdapter: add 'panic' and 'fatal error' as stopped reasons f9daaad src/goLogging.ts: add go.logging.level and log PATH mutation 9ebcc1f src/goLanguageServer.ts: include sanitized trace to issue report 9d97bb5 src/debugAdapter: delete unused launch.json 8d0bafa package.json: default 'go.coverMode' to be 'default' ed434b2 Merge "[latest] v0.17.0" e2dedc0 [latest] v0.17.0 5c4b766 src/debugAdapter: remove null items in variables response for maps 29cee47 debugAdapter: fix a bug where we are not sending back configuration done response 5879a3e test/gopls: fix completion middleware test 59858d7 src/goDebugConfiguration.ts: add resolveDebugConfiguration back 9a2bc10 src/debugAdapter: send stopped events from continue on breakpoint only d34fee8 docs/debugging.md: update remote debugging documentation a5e0287 build/all.bash: build vscode-test-env from the root c929a2b [latest] v0.16.2 2fe721b [latest] v0.16.1 586c956 [latest] v0.15.2 dc45442 [latest] v0.15.1 release eab00f7 [latest] v0.15.0 release Change-Id: If2f9a073a8a86754044e85671d5527b04d7c7ae4
2 parents b6fe8e2 + 9e91b75 commit e2e6b00

File tree

43 files changed

+1297
-2369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1297
-2369
lines changed

LICENSE

Lines changed: 0 additions & 2047 deletions
Large diffs are not rendered by default.

build/all.bash

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ prepare_nightly() {
7676
.displayName="Go Nightly" |
7777
.publisher="golang" |
7878
.description="Rich Go language support for Visual Studio Code (Nightly)" |
79-
.author.name="Go Team at Google" |
80-
.repository.url="https://github.com/golang/vscode-go" |
81-
.bugs.url="https://github.com/golang/vscode-go/issues"
79+
.contributes.configuration.properties."go.useLanguageServer".default=true
8280
') > /tmp/package.json && mv /tmp/package.json package.json
8381

8482
# Replace CHANGELOG.md with CHANGELOG.md + Release commit info.
@@ -91,20 +89,20 @@ prepare_nightly() {
9189

9290
# setup dependencies required for tests.
9391
install_dependencies() {
94-
GO111MODULE=on go get -x -v golang.org/x/tools/gopls
95-
GO111MODULE=on go get -x -v github.com/acroca/go-symbols
96-
GO111MODULE=on go get -x -v github.com/cweill/gotests/...
97-
GO111MODULE=on go get -x -v github.com/davidrjenni/reftools/cmd/fillstruct
98-
GO111MODULE=on go get -x -v github.com/haya14busa/goplay/cmd/goplay
99-
GO111MODULE=on go get -x -v github.com/mdempsky/gocode
100-
GO111MODULE=on go get -x -v github.com/ramya-rao-a/go-outline
101-
GO111MODULE=on go get -x -v github.com/rogpeppe/godef
102-
GO111MODULE=on go get -x -v github.com/sqs/goreturns
103-
GO111MODULE=on go get -x -v github.com/uudashr/gopkgs/v2/cmd/gopkgs
104-
GO111MODULE=on go get -x -v github.com/zmb3/gogetdoc
105-
GO111MODULE=on go get -x -v golang.org/x/lint/golint
106-
GO111MODULE=on go get -x -v golang.org/x/tools/cmd/gorename
107-
GO111MODULE=on go get -x -v github.com/go-delve/delve/cmd/dlv
92+
GO111MODULE=on go get -x golang.org/x/tools/gopls
93+
GO111MODULE=on go get -x github.com/acroca/go-symbols
94+
GO111MODULE=on go get -x github.com/cweill/gotests/...
95+
GO111MODULE=on go get -x github.com/davidrjenni/reftools/cmd/fillstruct
96+
GO111MODULE=on go get -x github.com/haya14busa/goplay/cmd/goplay
97+
GO111MODULE=on go get -x github.com/mdempsky/gocode
98+
GO111MODULE=on go get -x github.com/ramya-rao-a/go-outline
99+
GO111MODULE=on go get -x github.com/rogpeppe/godef
100+
GO111MODULE=on go get -x github.com/sqs/goreturns
101+
GO111MODULE=on go get -x github.com/uudashr/gopkgs/v2/cmd/gopkgs
102+
GO111MODULE=on go get -x github.com/zmb3/gogetdoc
103+
GO111MODULE=on go get -x golang.org/x/lint/golint
104+
GO111MODULE=on go get -x golang.org/x/tools/cmd/gorename
105+
GO111MODULE=on go get -x github.com/go-delve/delve/cmd/dlv
108106
}
109107

110108
main() {

docs/commands.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ Generates unit tests for the selected function in the current file
9191

9292
Generates method stub for implementing the provided interface and inserts at the cursor.
9393

94+
### `Go: Toggle gc details`
95+
96+
Toggle the display of compiler optimization choices
97+
9498
### `Go: Add Import`
9599

96100
Add an import declaration

docs/debug-adapter.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ As a next step, you may want to debug the Debug Adapter, in order to understand
2424
**NOTE: Since the Debug Adapter runs in a separate process from the rest of the extension, the steps below only enable you to debug the Debug Adapter code, not the entire extension. To debug the entire extension, as well as the debug adapter, see the instructions [below](#debug-the-entire-extension).**
2525

2626
1. Open the `vscode-go` folder in VS Code.
27-
2. Go the Run view and choose the `Launch as server` debug configuration.
27+
2. Go to the Run view and choose the `Launch as server` debug configuration.
2828
3. Add breakpoints as needed to the [`vscode-go/src/debugAdapter/goDebug.ts`](../src/debugAdapter/goDebug.ts) file.
2929
4. Open another instance of VS Code and open the Go project to debug.
3030
5. Create a debug configuration for the Go project if it doesn't exist. Set `"debugServer": 4711` in the root of the configuration.
3131
6. Start debugging your Go program using this configuration. This will trigger the breakpoints in [`goDebug.ts`](../src/debugAdapter/goDebug.ts) file.
3232

3333
## Debug the entire extension, including the Debug Adapter
3434

35-
You should take this step if your change modifies both the Debug Adapter and the main extension. This setup requires three instances of VS Code.
35+
You can take this step if your change modifies both the Debug Adapter and the main extension.
3636

37-
1. Open the root [`vscode-go`](../) folder in one instance of VS Code.
38-
2. Choose the `Launch Extension` debug target and run it (F5). This will launch the second instance of VS Code.
39-
3. In this second instance, open the Go application you'd like to debug. Here, as above, create a debug configuration pointing to the program you want to debug. Add `"debugServer": 4711` to the root of the configuration.
40-
4. Open the [`vscode-go/src/debugAdapter`](../src/debugAdapter) folder in a third VS Code instance. Select the `Launch as server` configuration and run it (`F5`).
41-
5. Return to the second VS Code instance with the Go program. Run the debug configuration (`F5`). Debuggers from the other two VS Code windows are attached to the Debug Adapter and the Go extension, so you can set breakpoints, step through code, and inspect state as needed.
37+
1. Open the `vscode-go` folder in VS Code.
38+
2. Go to the Run view and choose the `Extension + Debug server` debug configuration. This combines `Launch Extension` and `Launch as server` debug configurations.
39+
3. Add breakpoints as needed and start debugging (`F5`). It will start an Extension Development Host window and the Debug Adapter server process at port 4711. Debuggers are attached to both processes and the breakpoints will apply to both of them.
40+
4. In the Extension Development Host window, open the Go application source code you'd like to debug. Here, as above, create a debug configuration pointing to the program you want to debug. Add `"debugServer": 4711` to the root of the configuration. Then, run the debug configuration (`F5`), which will start debugging of the Go application.
41+
5. Combined debug information (call stacks, breakpoints, etc) of the debugged Extension Development Host and the Debug Adapter will be displayed in the debug view of the original VS Code window. You can use the dropdown menu in the Debug toolbar to switch between the two instances (`Launch Extension` and `Launch as server`).
4242

4343
## Debug VS Code and the Debug Adapter
4444

docs/debugging.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,14 @@ type | Always leave this set to `"go"`. VS Code uses this setting to deter
103103
request | One of `launch` or `attach`. Use `attach` when you want to attach to a running process.
104104
mode | For `launch` requests, one of `auto`, `debug`, `remote`, `test`, or `exec`. For `attach` requests, use `local` or `remote`.
105105
program | In `test` or `debug` mode, this refers to the absolute path to the package or file to debug. In `exec` mode, this is the existing binary file to debug. Not applicable to `attach` requests.
106-
env | Environment variables to use when debugging. Use the format: `{ "NAME": "VALUE" }`.
106+
env | Environment variables to use when debugging. Use the format: `{ "NAME": "VALUE" }`. Not applicable to `attach` requests.
107107
envFile | Absolute path to a file containing environment variable definitions. The environment variables passed in via the `env` property override the ones in this file.
108108
args | Array of command-line arguments to pass to the program being debugged.
109109
showLog | If `true`, Delve logs will be printed in the Debug Console panel.
110110
logOutput | Comma-separated list of Delve components (`debugger`, `gdbwire`, `lldbout`, `debuglineerr`, `rpc`) that should produce debug output when `showLog` is `true`.
111111
buildFlags | Build flags to pass to the Go compiler.
112-
remotePath | If remote debugging (`mode`: `remote`), this should be the absolute path to the file 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.
112+
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.
113+
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.
113114
processId | This is the process ID of the executable you want to debug. Applicable only when using the `attach` request in `local` mode.
114115

115116
### Specifying [build tags](https://golang.org/pkg/go/build/#hdr-Build_Constraints)
@@ -238,6 +239,19 @@ There is no snippet suggestion for this configuration.
238239
}
239240
```
240241

242+
If passing arguments to or calling subcommands and flags from a binary, the `args` property can be used.
243+
244+
```json
245+
{
246+
"name": "Launch executable",
247+
"type": "go",
248+
"request": "launch",
249+
"mode": "exec",
250+
"program": "/absolute/path/to/executable",
251+
"args": ["subcommand", "arg", "--flag"],
252+
}
253+
```
254+
241255
## Debugging on [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/)
242256

243257
If you are using using WSL, you will need the WSL 2 Linux kernel. See [WSL 2 Installation](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install) and note the Window 10 build version requirements.
@@ -266,21 +280,18 @@ Then, create a remote debug configuration in your `launch.json`.
266280
{
267281
"name": "Launch remote",
268282
"type": "go",
269-
"request": "launch",
283+
"request": "attach",
270284
"mode": "remote",
271-
"remotePath": "/absolute/path/file/on/remote/machine",
285+
"remotePath": "/absolute/path/dir/on/remote/machine",
272286
"port": 2345,
273287
"host": "127.0.0.1",
274-
"program": "/absolute/path/file/on/local/machine",
275-
"env": {}
288+
"cwd": "/absolute/path/dir/on/local/machine",
276289
}
277290
```
278291

279292
In the example, the VS Code debugger will run on the same machine as the headless `dlv` server. Make sure to update the `port` and `host` settings to point to your remote machine.
280293

281-
`remotePath` should point to the absolute path of the file being debugged in the remote machine. See [golang/vscode-go#126](https://github.com/golang/vscode-go/issues/126) for updates regarding `remotePath`.
282-
283-
`program` should point to the absolute path of the file on your local machine. This should be the counterpart of the file in `remotePath`.
294+
`remotePath` should point to the absolute path of the program being debugged in the remote machine. `cwd` should point to the absolute path of the working directory of the program being debugged on your local machine. This should be the counterpart of the folder in `remotePath`. See [golang/vscode-go#45](https://github.com/golang/vscode-go/issues/45) for updates regarding `remotePath` and `cwd`.
284295

285296
When you run the `Launch remote` target, VS Code will send debugging commands to the `dlv` server you started, instead of launching it's own `dlv` instance against your program.
286297

@@ -375,6 +386,12 @@ Docker has security settings preventing `ptrace(2)` operations by default within
375386

376387
This error can show up for Mac users using Delve versions 0.12.2 and above. `xcode-select --install` has solved the problem for a number of users.
377388

389+
### Debugging symlink directories
390+
391+
This extension does not provide support for debugging projects containing symlinks. Make sure that you are setting breakpoints in the files that Go will use to compile your program.
392+
393+
For updates to symlink support reference [golang/vscode-go#622](https://github.com/golang/vscode-go/issues/622).
394+
378395
[Delve]: https://github.com/go-delve/delve
379396
[VS Code variables]: https://code.visualstudio.com/docs/editor/variables-reference
380397
[snippets]: https://code.visualstudio.com/docs/editor/userdefinedsnippets

docs/go-version.md

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

33
## Using The Go Status Bar
44

5-
You can view the current Go version by looking at the status bar item in the bottom left corner of VS Code. Clicking this button will present you with a menu from which you can select any version of Go that exists in your $HOME/sdk directory or on <https://golang.org/dl>.
5+
You can view the current Go version by looking at the status bar item in the bottom left corner of VS Code. Clicking this button and selecting `Choose Go Environment` will present you with a menu from which you can select any version of Go that exists in your $HOME/sdk directory or on <https://golang.org/dl>. This command is also available through the command pallette using `Go: Choose Go Environment`.
66

77
Previously, the `go.goroot` and `go.alternateTools` settings controlled the Go version used by VS Code Go. If you have configured these settings, they are no longer needed and should be deleted.
88

docs/settings.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ Default:{<br/>
292292
}
293293

294294

295+
### `go.logging.level`
296+
297+
The logging level the extension logs at, defaults to 'error'
298+
299+
Allowed Values:`[off error info verbose]`
300+
301+
Default: `error`
302+
295303
### `go.overwriteGoplsMiddleware`
296304

297305
This option provides a set of flags which determine if vscode-go should intercept certain commands from gopls. These flags assume the `gopls` settings, which enable codelens from gopls, are also present.

docs/stdlib.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,36 @@ First, you **must open the `src/` folder in VS Code**, not the Go tree root.
66
(See [golang/go#32394](https://github.com/golang/go/issues/32394).)
77

88
Then, you need to configure the workspace, by placing the following in `src/.vscode/settings.json`.
9+
[Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette)
10+
-> `Preferences: Open Workspace Settings (JSON)` will open the setting file.
911

1012
```json5
1113
{
12-
// Use the local go tool. This needs to be built with make.bash.
13-
"go.alternateTools": {
14-
"go": "~/godev/bin/go"
15-
},
16-
// Build a separate set of tools. For golang/vscode-go#294.
17-
"go.toolsGopath": "~/.vscode/godev",
18-
// Don't reformat HTML files since we have a custom style.
19-
"html.format.enable": false,
14+
// Use the local go tool. This needs to be built with make.bash.
15+
"go.alternateTools": {
16+
"go": "~/godev/bin/go"
17+
},
18+
19+
//
20+
// Below is optional.
21+
//
22+
// Build a separate set of tools. For golang/vscode-go#294.
23+
"go.toolsGopath": "~/.vscode/godev",
24+
// Don't reformat HTML files since we have a custom style.
25+
"html.format.enable": false
2026
}
2127
```
2228

2329
The above assumes the Go tree is checked out at `~/godev`. If your Go tree is somewhere else, modify
24-
`go.alternateTools.go` accordingly.
30+
`go.alternateTools.go` to point to the go *binary* accordingly. Many underlying tools
31+
including `gopls` invoke the go command (`go list`, etc), so we assume the binary isn't
32+
completely broken.
2533

2634
You can add `.vscode` to `.git/info/exclude` to avoid risking checking `settings.json` into git.
2735

36+
The Go language server ([`gopls`](https://golang.org/s/gopls)) works for developing the standard
37+
library. To enable it, please read our [`gopls` documentation](gopls.md).
38+
2839
If you see an "inconsistent vendoring" error, please report it at
2940
[golang/go#40250](https://github.com/golang/go/issues/40250).
3041

docs/tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ If you want to invoke tools other than `go`, you will have to move the `"command
6565
"label": "run",
6666
"command": "go",
6767
"args": ["run", "${file}"],
68-
"group": "build"
68+
"group": "build",
6969
"type": "shell",
7070
},
7171
{

package-lock.json

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

0 commit comments

Comments
 (0)