Skip to content

Commit 9a81869

Browse files
committed
[release] all: prepare v0.21.0 release
fd5d558 CHANGELOG.md: prepare for v0.21.0 release b7b9a3e test/*: use getGoConfig instead of directly calling vscode API 3e3f506 src/util: resolveToolsGopath ignores toolsGopath from untrusted workspace e1a6cb4 package.json: update settings description to mark dangerous settings bc8b63e src/config: move getGoConfig/getGoplsConfig to config 3a013bd src/config.ts: initialize the Configuration singleton during activation d62869d package.json: address comments from cl/280697 1ac4671 src/config: add Configuration class to encapsulate the extension settings b15a5cc tools/generate: move gopls settings to a dedicated section 2b54c86 src/goMain: fix build breakage - isNightly is renamed d2e07f8 CHANGELOG.md: v0.20.2 70ef416 src/goMain.ts: show welcome page on update 55eb46d package.json: switch the main branch in preview mode 60116ee src/goLanguageServer: include .tmpl only in nightly mode. 4f8150a src/goLanguageServer.ts: deduplicate diagnostics from language client 34d732e package.json: change go.toolsGopath default to null 64847ab src/goLanguageServer: report when falling back to default providers 3b5f327 vscode-go: allow gopls to see .tmpl files d9b30a2 media/welcome.css: add style to the welcome webview 4c91c38 src/goLanguageServer: remove languageServerExperimentalFeatures f9896e8 src/goStatus: avoid statusBarEntry leak 898e719 docs/settings.md: fix the settings for the context menu 04c1bcf src/goLanguageServer: fix a bug that prevented gopls start after forced update cda36be src/debugAdapter: add dlvFlags to accept arbitrary delve flags 705272c src/goLiveErrors: disable gotype-live when language server is enabled ae693b8 src/welcome.ts: add 'latest updates' section to welcome page 0dc4650 src/welcome.ts: add external resources to welcome page 197bec6 src/welcome.ts: add welcome webview de64eaa tools/goplssetting: handle changes in gopls setting structure 343a5dc src/goLanguageServer: deprecate documentLink configuration b730717 docs/gopls.md: remove the link of `gopls` settings block section e7a2363 src/debugAdapter: address TS2794 warnings 229c425 CHANGELOG.md: describe v0.20.1 change 811693e CHANGELOG.md: Change logs for v0.20.0 dd9c54f src/utils/pathUtils: return the default go path only if exists 0abde47 docs/gopls.md: update documentation about `gopls` block 83197d8 build: install typescript in Dockerfile and adjust .vscodeignore 61dae92 README.md: place gopls by default announcement Change-Id: I606d15d08c4b6f36a63b9d3dea27c7aca92df843
2 parents 98d8a1a + fd5d558 commit 9a81869

Some content is hidden

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

73 files changed

+1366
-553
lines changed

.vscodeignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
**/*.map
22
**/tslint.json
3-
.github/**/*
3+
.git/
4+
.github/
45
.gitignore
56
.prettierrc.json
6-
.vscode-test/**
7+
.user-data-dir-test/
78
.vscode/
9+
.vscode-test/
810
SECURITY.md
911
build/
1012
docs/
11-
node_modules
13+
node_modules/
1214
out/
1315
src/
1416
test/

CHANGELOG.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
## v0.21.0 - 20th Jan, 2021
2+
3+
> 📣   Announcement:
4+
>
5+
> * The language server, `gopls`, will be enabled by default in the next release. ([Issue 1037](https://github.com/golang/vscode-go/issues/1037)). Please test and provide us your feedback on the `#vscode-dev` [Gophers Slack](https://gophers.slack.com/) channel.
6+
>
7+
> * Some workspace or folder-level settings that affect tools location will not be used by default until users explicitly opt in by running `Go: Toggle Workspace Trust Flag`. See [Issue 1094](https://github.com/golang/vscode-go/issues/1094) for more information.
8+
9+
A list of all issues and changes can be found in the [v0.21.0 milestone](https://github.com/golang/vscode-go/milestone/16?closed=1).
10+
### Enhancements
11+
- The new `dlvFlags` debug attribute is available for conveniently supply extra flags to `dlv`. ([Issue 978](https://github.com/golang/vscode-go/issues/978))
12+
- Stop using workspace/folder-level settings from untrusted repositories that can be used to run arbitrary binaries. ([Issue 1024](https://github.com/golang/vscode-go/issues/1094))
13+
- The extension now deduplicates diagnostics from both the language server and the linter. ([Issue 142](https://github.com/golang/vscode-go/issues/142))
14+
- Disabled `gotype-live` automatically when the language server is enabled. ([Issue 1021](https://github.com/golang/vscode-go/issues/1021))
15+
- Removed the `"go.languageServerExperimentalFeatures"` setting. ([CL 280601](https://go-review.googlesource.com/c/vscode-go/+/280601)). The `documentLink` feature is replaced with `gopls`'s [`ui.navigation.importShortcut`](https://github.com/golang/tools/blob/master/gopls/doc/settings.md#importshortcut-enum) setting. The `diagnostics` feature replacement is still under discussion. Please provide feedback in [Issue 50](https://github.com/golang/vscode-go/issues/50).
16+
17+
### Code Health
18+
* Experimental features that were available only in the nightly extension are enabled in the master branch, and in presubmit & CI tests running on the master branch.
19+
### Thanks
20+
21+
Thank you for your contribution, @hyangah, @suzmue, @pjweinbgo, @stamblerre!
22+
123
## v0.20.2 - 8th Jan, 2021
224

325
### Enhancement
@@ -12,10 +34,6 @@
1234

1335
A list of all issues and changes can be found in the [v0.20.0 milestone](https://github.com/golang/vscode-go/milestone/18?closed=1).
1436

15-
> 📣   Announcement: We plan to enable the language server, `gopls`, by default early next year. ([Issue 1037](https://github.com/golang/vscode-go/issues/1037))
16-
>
17-
> Please test and provide us your feedback on the `#vscode-dev` [Gophers Slack](https://gophers.slack.com/) channel.
18-
1937
### Enhancements
2038
- Debugging
2139
- The new `substitutePath` config property allows users to translate their symlinked directories to the actual paths, and

build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ENV PATH /workspace/vscodego/go/bin:/go/bin:/usr/local/go/bin:${PATH}
2727
ENV DEBIAN_FRONTEND noninteractive
2828

2929
RUN apt-get update && apt-get install -y libnss3 libgtk-3-dev libxss1 libasound2 xvfb libsecret-1-0
30-
RUN npm install -g vsce
30+
RUN npm install -g typescript vsce
3131

3232
WORKDIR /workspace
3333
ENTRYPOINT ["build/all.bash"]

docs/commands.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ Generates method stub for implementing the provided interface and inserts at the
9595

9696
Extract logs in the `gopls (server)` output channel to the editor.
9797

98+
### `Go: Welcome`
99+
100+
Open the welcome page for the Go extension.
101+
98102
### `Go: Toggle gc details`
99103

100104
Toggle the display of compiler optimization choices
@@ -202,3 +206,7 @@ Show the current Go survey configuration
202206
### `Go: Reset Survey Configuration`
203207

204208
Reset the current Go survey configuration history
209+
210+
### `Go: Toggle Workspace Trust Flag`
211+
212+
Toggle the workspace trust flag. Workspace settings that determine tool locations are disabled by default in untrusted workspaces.

docs/debugging.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ program | In `test` or `debug` mode, this refers to the absolute path to the
107107
env | Environment variables to use when debugging. Use the format: `{ "NAME": "VALUE" }`. Not applicable to `attach` requests.
108108
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.
109109
args | Array of command-line arguments to pass to the program being debugged.
110-
showLog | If `true`, Delve logs will be printed in the Debug Console panel.
111-
logOutput | Comma-separated list of Delve components (`debugger`, `gdbwire`, `lldbout`, `debuglineerr`, `rpc`) that should produce debug output when `showLog` is `true`.
112-
buildFlags | Build flags to pass to the Go compiler.
110+
showLog | If `true`, Delve logs will be printed in the Debug Console panel. This corresponds to `dlv`'s `--log` flag.
111+
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.
112+
buildFlags | Build flags to pass to the Go compiler. This corresponds to `dlv`'s `--build-flags` flag.
113+
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`, `--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.
113114
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.
114115
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)(https://github.com/go-delve/delve/tree/master/Documentation/cli#config)) configuration, and will eventually configure substitute-path in Delve directly.
115116
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.

docs/gopls.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# [`gopls`], the Go language server
22

3-
[`gopls`] is the official Go [language server](https://langserver.org/) developed by the Go team. It was developed in response to the release of [Go modules], and it is the recommended approach when working with [Go modules] in VS Code.
4-
5-
[`gopls`] is currently in an alpha state, so it is not enabled by default. Please note that [`gopls`] only supports Go versions above 1.12.
3+
[`gopls`] is the official Go [language server](https://langserver.org/) developed by the Go team. It was developed in response to the release of [Go modules], and it is the recommended approach when working with [Go modules] in VS Code. [`gopls`] is not enabled by default yet and users have to opt in by changing from [their settings](#enable-the-language-server). We plan to switch the default and enable it by default early 2021.
64

75
[`gopls`] has its own [documentation pages](https://github.com/golang/tools/tree/master/gopls/doc), and they should be treated as the source of truth for how to use [`gopls` in VS Code](https://github.com/golang/tools/blob/master/gopls/doc/vscode.md).
86

@@ -13,7 +11,6 @@
1311
* [Automatic updates](#automatic-updates)
1412
* [Configuration](#configuration)
1513
* [Ignored settings](#ignored-settings)
16-
* [`gopls` settings block](#gopls-settings-block)
1714
* [Troubleshooting](https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md)
1815
* [Additional resources](#additional-resources)
1916

@@ -41,27 +38,18 @@ If you would like to opt-out of these updates, set [`"go.useGoProxyToCheckForToo
4138

4239
There are a number of VS Code Go settings for controlling the language server.
4340

41+
* [`"go.toolsEnvVars"`](settings.md#go.toolsEnvVars) is used when launching `gopls` for the workspace.
42+
* [`"go.buildFlags"`](settings.md#go.buildFlags) and [`"go.buildTags"`](settings.md#go.buildTags) are propagated to `gopls`.
4443
* [`"go.languageServerExperimentalFeatures"`](settings.md#go.languageServerExperimentalFeatures) allows you to disable certain features.
4544
* `"diagnostics": false` disables diagnostic warnings from `gopls`. You might want to disable these if you don't like the diagnostics changing as you type.
46-
* `"documentLink": false` disables document links. The reason to disable these is explained in [golang/go#39065](https://github.com/golang/go/issues/39065): the Ctrl+Click shortcut for clicking on a link collides with the Ctrl+Click shortcut for go-to-definition.
45+
* `"documentLink": false` is deprecated by `"gopls": { "importShortcut": false }` setting. It was originally meant to disable document links. The reason to disable these is explained in [golang/go#39065](https://github.com/golang/go/issues/39065): the Ctrl+Click shortcut for clicking on a link collides with the Ctrl+Click shortcut for go-to-definition.
4746
* [`"go.languageServerFlags"`](settings.md#go.languageServerFlags) allows you to pass flags to the `gopls` process.
4847
* The `-rpc.trace` flag enables verbose debug logging.
48+
* [`"gopls"`](settings.md#gopls) allows to fine-tune gopls behavior or override the settings propagated from the extension settings (e.g. `"go.buildFlags"`, `"go.toolsEnvVars"`) as shown in the [`gopls` VS Code user guide](https://github.com/golang/tools/blob/master/gopls/doc/vscode.md). The sets of settings recognized by the extension and the gopls may differ if you use an old version or a pre-release version of `gopls`. In that case, the source of truth is in [the documentation](https://github.com/golang/tools/tree/master/gopls/doc/settings.md) in the `gopls` project.
4949

5050
### Ignored settings
5151

52-
A number of the extension's settings are not passed in to `gopls`. We are working on unifying all of the settings, but some may still be ignored. These include:
53-
54-
* [`"go.buildFlags"`](settings.md#go.buildFlags)
55-
56-
These configurations can be passed to `gopls` via your environment or the `gopls.env` setting. Learn more in the [`gopls` VS Code documentation](https://github.com/golang/tools/blob/master/gopls/doc/vscode.md#build-tags).
57-
58-
### `gopls` settings block
59-
60-
`gopls` exposes much more [configuration](https://github.com/golang/tools/blob/master/gopls/doc/settings.md). However, because [`gopls`] is in a state of rapid development and change, these settings change frequently. Therefore, we have not yet built these settings into the Go extension.
61-
62-
As shown in the [`gopls` VS Code user guide](https://github.com/golang/tools/blob/master/gopls/doc/vscode.md), you can still configure these settings through VS Code by adding a `"gopls"` block to your `settings.json` file (Command Palette -> Preferences: Open Settings (JSON)). **You will see an `Unknown Configuration Setting` warning, but the settings will still work.** Add any settings there, and `gopls` will warn you if they are incorrect, unknown, or deprecated.
63-
64-
A full list of `gopls` settings is available in the [`gopls` settings documentation](https://github.com/golang/tools/blob/master/gopls/doc/settings.md).
52+
Some of the extension's settings are irrelevant when `gopls` is enabled. For example, the extension no longer uses `gocode` or `guru`, so the corresponding settings are no longer applicable. We are trying to document that in the settings' description and the [settings documentation](settings.md). When you find incompelete documentation, please file an issue or send a PR!
6553

6654
## Additional resources
6755

0 commit comments

Comments
 (0)