Skip to content

Commit 47a7452

Browse files
committed
[release] prepare v0.17.0 release
322e058 0.16.2 release CHANGELOG 368fc43 src/util.ts: allow getGoVersion when there is no active text editor c23df8f src/goLanguageServer.ts: restart if go.toolsEnvVars changes f8bce8c src/goBuild: remove misleading error message in modules mode dcea773 src/goCover.ts: correct windows absolute filepath handling 02869c8 src/goPackages.ts: pass GOROOT to gopkgs 0b32079 docs/switch-version.md: add Go version switching documentation 1080e21 src/util.ts,goLanguageServer.ts: set cwd for cp.execFile d594eec build: add setup_env to all.bash and update contributing.md c705adf src/goInstallTools: report `go env` failure f2fd351 src/debugAdapter: make filepaths in errors absolute 52260e0 src/goCover.ts: provide explicit directory for running go list 859bb8a src/goTools.ts: recognize gofumpt, gofumports formatters d05379e test/integration: increase extension test timeout 43d6d04 package.json: let some commands activate extension 5a7752c src/debugAdapter: add delve 'call' command support 575abde src/goEnvironmentStatus: fix PATH mutation logic in osx 77bda0a test/gopls: print gopls traces when test fails 2c287db src/goDebugConfiguration: expand '~' in cwd attribute bd77a6f src/testUtils.ts: always run test in package list mode a7b1705 test/integration: add extra tests for env var combining 3ffb96e src/goCover: remove obsolete go.coverageDecorator support da7328b package.json: disable debug config's showGlobalVariables by default 4b52e43 package.json: disable go.installDependenciesWhenBuilding by default c7c4188 src/goDebugConfiguration: combine envFile and env cd41bd1 .github/workflows, build: install dlv in containers c169d13 src/utils/envUtils.ts: add parseEnvFiles eeb2512 src/utils: move env var utilities to its own module 95570ec goLanguageServer: attach gopls version to issue reports e15a8a2 docs: link to more VS Code docs, add alternative ways to start 8f16fe4 tools/generate.go: add defaults and enums to settings.md 9167ad2 docs: add stdlib.md 7f493bf src/goEnvironmentStatus.ts: notify user of available Go updates 1e4dbe2 src/testUtils.ts: fix parsing of the compiler error file expansion 47e2496 docs: fix out-of-sync documentation 139fd7d src/goCover.go: add go.coverMode to display coverage data and counts d41272c src/util.ts: log `go version` output 6aa134d src/goInstallTools.ts: fix the installation failure message e1603dd package.json: allow additional properties for alternateTools 56f2f9e src/goLanguageServer.ts: update middleware arguments to match gopls 5089f49 build,.github/workflows: use go1.15 2bd6cd6 docs: expand debugging instructions f4f147c build: add line breaks to build/Dockerfile 116a0a0 package.json: prepare for 0.17.0 dev bc9db1e CHANGELOG.md: cherry-pick v0.16.1 CHANGELOG update aabbc51 src/goLanguageServer.ts: add config to overwrite vscode-go codelens bec9cf3 src/testUtil.ts: switch to -json mode only if -v is set 9bdb768 build,.github/workflows: install all tools in modules mode f9c0454 src/debugAdapter2: launch as an external process, and fix config c3f97ff goLanguageServer: change survey prompt probability to 2.75% d1404a0 src/goLanguageServer.ts: handle missing filterText in completion items 6a84918 src/goEnv.ts: readd go.toolsEnvVars variable substitution c6695aa src/goMain.ts: reinstate the goroot var interpolation c22bbe5 CHANGELOG.md: v0.16.0 release note 9523e4b src/goInstallTools.ts: avoid type check error 18eaf7e src/goEnvironmentStatus.ts: ignore uninstalled Go on network failure fe3c6b5 package.json: require vscode 1.46 or up 9d1620b src/goLanguageServer.ts: add "debug test" and "debug benchmark" codelens e3aa3a2 src: npm run fix-lint d8f9560 src/goEnvironmentStatus.ts: handle failed getGoVersion call dc9de1c src/util.ts: attempt to fix version parsing again bd41c5e src/goLanguageServer.ts: fix broken event forwarding in middleware Change-Id: I19a6f21822f3ea65b8868a26dd15f1522f8eb7d9
2 parents ede72ef + 322e058 commit 47a7452

Some content is hidden

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

48 files changed

+1534
-380
lines changed

.github/workflows/release-nightly.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup Go
3030
uses: actions/setup-go@v1
3131
with:
32-
go-version: '1.14'
32+
go-version: '1.15'
3333

3434
- name: Install dependencies
3535
run: npm ci
@@ -55,18 +55,12 @@ jobs:
5555
go get golang.org/x/lint/golint
5656
go get golang.org/x/tools/cmd/gorename
5757
go get golang.org/x/tools/gopls
58+
go get github.com/cweill/gotests/...
59+
go get github.com/rogpeppe/godef
60+
go get github.com/ramya-rao-a/go-outline
61+
go get github.com/go-delve/delve/cmd/dlv
5862
env:
5963
GO111MODULE: on
60-
61-
- name: Install Go tools (GOPATH mode)
62-
run: |
63-
go version
64-
go get github.com/cweill/gotests/...
65-
go get github.com/rogpeppe/godef
66-
go get github.com/ramya-rao-a/go-outline
67-
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
68-
env:
69-
GO111MODULE: off
7064

7165
- name: Run unit tests
7266
run: npm run unit-test

.github/workflows/test-long.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Setup Go
3434
uses: actions/setup-go@v1
3535
with:
36-
go-version: '1.14'
36+
go-version: '1.15'
3737

3838
- name: Install dependencies
3939
run: npm ci
@@ -54,19 +54,13 @@ jobs:
5454
go get golang.org/x/lint/golint
5555
go get golang.org/x/tools/cmd/gorename
5656
go get golang.org/x/tools/gopls
57+
go get github.com/cweill/gotests/...
58+
go get github.com/rogpeppe/godef
59+
go get github.com/ramya-rao-a/go-outline
60+
go get github.com/go-delve/delve/cmd/dlv
5761
env:
5862
GO111MODULE: on
5963

60-
- name: Install Go tools (GOPATH mode)
61-
run: |
62-
go version
63-
go get github.com/cweill/gotests/...
64-
go get github.com/rogpeppe/godef
65-
go get github.com/ramya-rao-a/go-outline
66-
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
67-
env:
68-
GO111MODULE: off
69-
7064
- name: Run unit tests
7165
run: npm run unit-test
7266

.github/workflows/test-smoke.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup Go
3030
uses: actions/setup-go@v1
3131
with:
32-
go-version: '1.14'
32+
go-version: '1.15'
3333

3434
- name: Install dependencies
3535
run: npm ci
@@ -50,18 +50,12 @@ jobs:
5050
go get golang.org/x/lint/golint
5151
go get golang.org/x/tools/cmd/gorename
5252
go get golang.org/x/tools/gopls
53+
go get github.com/cweill/gotests/...
54+
go get github.com/rogpeppe/godef
55+
go get github.com/ramya-rao-a/go-outline
56+
go get github.com/go-delve/delve/cmd/dlv
5357
env:
54-
GO111MODULE: on
55-
56-
- name: Install Go tools (GOPATH mode)
57-
run: |
58-
go version
59-
go get github.com/cweill/gotests/...
60-
go get github.com/rogpeppe/godef
61-
go get github.com/ramya-rao-a/go-outline
62-
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
63-
env:
64-
GO111MODULE: off
58+
GO111MODULE: on
6559

6660
- name: Run unit tests
6761
run: npm run unit-test
@@ -75,4 +69,4 @@ jobs:
7569

7670
- name: Lint check
7771
run: npm run lint
78-
if: ${{ matrix.os }} == 'ubuntu-latest'
72+
if: ${{ matrix.os }} == 'ubuntu-latest'

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- Fixed the regression that caused to run tests in the local directory mode and
77
result in more verbose output than the package list mode. ([Issue 528](https://github.com/golang/vscode-go/issues/528)).
88
- Fixed `"go.alternateTools"` settings to accept any tool names without
9-
settings.json diagnostics warning. ([Issue 526](https://github.com/golang/vscode-go/issues/526)
9+
settings.json diagnostics warning. ([Issue 526](https://github.com/golang/vscode-go/issues/526))
1010

1111

1212
## v0.16.1 - 5th Aug, 2020
@@ -94,7 +94,6 @@ can see the details of the test results, but we will continue working to make th
9494

9595
Thank you for your contribution, fujimoto kyosuke, OneOfOne, Aditya Thakral, Oleg Butuzov, Rebecca Stambler, Peter Weinberger, Brayden Cloud, Eli Bendersky, Robert Findley, Hana Kim!
9696

97-
9897
## v0.15.2 - 21st July, 2020
9998

10099
### Fixed

build/Dockerfile

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# This Docker container is used for testing on GCB.
22

3-
FROM golang:1.14 AS gobuilder
3+
FROM golang:1.15 AS gobuilder
44

55
ENV GO111MODULE on
66
ENV GOBIN /gobin
7-
ENV GOPROXY https://proxy.golang.org
8-
RUN cd $(mktemp -d) && go get golang.org/x/tools/gopls@latest
7+
8+
# Install other Go tools tests depend on
9+
RUN mkdir -p /scratch/build
10+
ADD build/all.bash /scratch/build/all.bash
11+
RUN /scratch/build/all.bash setup_env
912

1013
FROM node:latest
1114

@@ -14,28 +17,11 @@ RUN mkdir /go
1417
COPY --from=gobuilder /gobin /go/bin
1518
COPY --from=gobuilder /usr/local/go /usr/local/go
1619

17-
# TODO(hyangah): some tests fail if GOPATH is not set. Fix them.
18-
ENV GOPATH=/go
19-
ENV PATH=${GOPATH}/bin:/usr/local/go/bin:${PATH}
20+
ENV GOPATH /go
21+
ENV PATH ${GOPATH}/bin:/usr/local/go/bin:${PATH}
2022
ENV DEBIAN_FRONTEND noninteractive
2123

2224
RUN apt-get update && apt-get install -y libnss3 libgtk-3-dev libxss1 libasound2 xvfb libsecret-1-0
2325

24-
# Install other Go tools tests depend on
25-
RUN go get -u -v \
26-
github.com/acroca/go-symbols \
27-
github.com/cweill/gotests/... \
28-
github.com/davidrjenni/reftools/cmd/fillstruct \
29-
github.com/haya14busa/goplay/cmd/goplay \
30-
github.com/mdempsky/gocode \
31-
github.com/ramya-rao-a/go-outline \
32-
github.com/rogpeppe/godef \
33-
github.com/sqs/goreturns \
34-
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
35-
github.com/zmb3/gogetdoc \
36-
golang.org/x/lint/golint \
37-
golang.org/x/tools/cmd/gorename
38-
39-
4026
WORKDIR /workspace
4127
ENTRYPOINT ["build/all.bash"]

build/all.bash

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Available subcommands:
1111
help - display this help message.
1212
test - build and test locally. Some tests may fail if vscode is already in use.
1313
testlocal - build and test in a locally built container.
14+
setup_env - setup environment for test. This installs tools under GOPATH/bin.
1415
ci - build and test with headless vscode. Requires Xvfb.
1516
EOUSAGE
1617
}
@@ -88,6 +89,24 @@ prepare_nightly() {
8889
cp build/nightly/const.ts src/const.ts
8990
}
9091

92+
# setup dependencies required for tests.
93+
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
108+
}
109+
91110
main() {
92111
cd "$(root_dir)" # always run from the script root.
93112
case "$1" in
@@ -110,6 +129,9 @@ main() {
110129
"prepare_nightly")
111130
prepare_nightly
112131
;;
132+
"setup_env")
133+
install_dependencies
134+
;;
113135
*)
114136
usage
115137
exit 2

docs/contributing.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ If you make subsequent edits in the codebase, you can reload (`Ctrl+R`) the `[Ex
6262
6363
## Test
6464
65+
Simple unit tests that do not require interaction with VS Code are located in `test/unit`.
66+
Tests in `test/integration` and `test/gopls` directories are integration tests. They involve invocation of the VS Code API and
67+
require external Go tools installed in `GOPATH`. The command `setup_env` in [`build/all.bash`](https://github.com/golang/vscode-go/blob/master/build/all.bash)
68+
installs all the tool dependencies in `GOPATH`.
69+
70+
1. `export GOPATH=/path/to/gopath/for/test`
71+
1. `build/all.bash setup_env`
72+
1. Unfortunately, VS Code test framework inherits your user settings when running tests [Issue 43](https://github.com/golang/vscode-go/issues/43). Make sure VS Code user settings do not contain any go related configuration, except `go.gopath` or `go.toolsGopath` in case you installed the tools for testing in a different `GOPATH`.
73+
6574
There are currently three test launch configurations: (1) `Launch Extension Tests`, (2) `Launch Extension Tests with Gopls`, and (3) `Launch Unit Tests`. To run the tests locally, open the Run view (`Ctrl+Shift+D`), select the relevant launch configuration, and hit the Play button (`F5`).
6675
6776
## Sideload

docs/debugging.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,29 @@ This document explains how to debug your Go programs in VS Code. The Go debugger
2828

2929
[Delve] should be installed by default when you install this extension.
3030

31+
You may need to update `dlv` to the latest version to support the latest version
32+
of Go—see [Installation](#installation) below.
33+
3134
### Installation
3235

33-
You can also install it manually in one of two ways:
36+
You can also install Delve manually in one of two ways:
3437

35-
1. Open the Command Palette (Ctrl+Shift+P), select [`Go: Install/Update Tools`](settings.md#go-installupdate-tools), and select [`dlv`](tools.md#dlv).
38+
1. Open the [Command Palette][] (Windows/Linux: Ctrl+Shift+P; OSX: Shift+Command+P), select [`Go: Install/Update Tools`](settings.md#go-installupdate-tools), and select [`dlv`](tools.md#dlv).
3639
2. Follow the [Delve installation instructions](https://github.com/go-delve/delve/tree/master/Documentation/installation).
3740

41+
### Start debugging
42+
43+
1. Open the `package main` source file or the test file you want to debug.
44+
2. Start debugging using one of the following options:
45+
* Open the [Command Palette][], select
46+
`Debug: Start Debugging`, then select `Go`.
47+
* Open the debug window (Windows/Linux: Ctrl+Shift+D; OSX: Shift+Command+D) and click
48+
`Run and Debug`, then select `Go`.
49+
* Select **Run > Start Debugging** from the main menu.
50+
51+
See [the VS Code Debugging documentation](https://code.visualstudio.com/docs/editor/debugging)
52+
for more information.
53+
3854
### Configuration
3955

4056
You may not need to configure any settings to start debugging your programs, but you should be aware that the debugger looks at the following settings.
@@ -50,7 +66,7 @@ You may not need to configure any settings to start debugging your programs, but
5066
* `maxStructFields`: Maximum number of fields read from a struct. A setting of `-1` indicates that all fields should be read (default: `-1`).
5167
* `maxVariableRecurse`: How far to recurse when evaluating nested types (default: `1`).
5268
* `followPointers`: Automatically dereference pointers (default: `true`).
53-
* `showGlobalVariables`: Show global variables in the Debug view (default: `true`).
69+
* `showGlobalVariables`: Show global variables in the Debug view (default: `false`).
5470

5571
There are some common cases when you might want to tweak the Delve configurations.
5672

@@ -362,3 +378,4 @@ This error can show up for Mac users using Delve versions 0.12.2 and above. `xco
362378
[Delve]: https://github.com/go-delve/delve
363379
[VS Code variables]: https://code.visualstudio.com/docs/editor/variables-reference
364380
[snippets]: https://code.visualstudio.com/docs/editor/userdefinedsnippets
381+
[Command Palette]: https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette

docs/go-version.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Managing Your Go Version
2+
3+
## Using The Go Status Bar
4+
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>.
6+
7+
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.
8+
9+
[](https://i.imgur.com/8qh2Tu2.png)
10+
11+
The "Clear Selection" option resets your Go version to the one found first in either `go.alternateTools`, `go.goroot` or your PATH.
12+
13+
## Installing a New Go Version
14+
15+
After selecting any Go version that has not yet been installed (such as Go 1.14.6 in the screenshot above), the binary will be automatically installed in $HOME/sdk and put to use in your environment.
16+
17+
Once the download completes, VS Code Go will make use of this new Go version.

0 commit comments

Comments
 (0)