Skip to content

Commit 8b4aab6

Browse files
committed
gopls/doc/vscode.md: update vscode setting example
Update the vscode settings example based on the new settings organization. Change-Id: I6a52cc525a038caa4f35716f6a8c2be145b5238e Reviewed-on: https://go-review.googlesource.com/c/tools/+/283394 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]> gopls-CI: kokoro <[email protected]>
1 parent 9a6582c commit 8b4aab6

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

gopls/doc/settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ like this:
1212

1313
```json5
1414
"gopls": {
15-
"usePlaceholders": true,
16-
"completeUnimported": true
15+
"ui.completion.usePlaceholders": true,
16+
...
1717
},
1818
```
1919

gopls/doc/vscode.md

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,15 @@ Use the [VSCode-Go] plugin, with the following configuration:
1919
},
2020
},
2121
"gopls": {
22-
// Add parameter placeholders when completing a function.
23-
"usePlaceholders": true,
22+
// Add parameter placeholders when completing a function.
23+
"ui.completion.usePlaceholders": true,
2424

2525
// If true, enable additional analyses with staticcheck.
2626
// Warning: This will significantly increase memory usage.
27-
"staticcheck": false,
28-
}
29-
```
30-
31-
VSCode will complain about the `"gopls"` settings, but they will still work. Once we have a consistent set of settings, we will make the changes in the VSCode plugin necessary to remove the errors.
32-
33-
If you encounter problems with import organization, please try setting a higher code action timeout (any value greater than 750ms), for example:
34-
35-
```json5
36-
"[go]": {
37-
"editor.codeActionsOnSaveTimeout": 3000
27+
"ui.diagnostic.staticcheck": false,
28+
29+
// For more customization, see
30+
// see https://github.com/golang/vscode-go/blob/master/docs/settings.md
3831
}
3932
```
4033

@@ -44,23 +37,17 @@ To enable more detailed debug information, add the following to your VSCode sett
4437
"go.languageServerFlags": [
4538
"-rpc.trace", // for more detailed debug logging
4639
"serve",
47-
"--debug=localhost:6060", // to investigate memory usage, see profiles
40+
"--debug=localhost:6060", // Optional: to investigate memory usage, see profiles
4841
],
4942
```
5043

5144
See the section on [command line](command-line.md) arguments for more information about what these do, along with other things like `--logfile=auto` that you might want to use.
5245

5346
You can disable features through the `"go.languageServerExperimentalFeatures"` section of the config. An example of a feature you may want to disable is `"documentLink"`, which opens [`pkg.go.dev`](https://pkg.go.dev) links when you click on import statements in your file.
5447

55-
### Build tags
56-
57-
build tags will not be picked from `go.buildTags` configuration section, instead they should be specified as part of the`GOFLAGS` environment variable:
48+
### Build tags and flags
5849

59-
```json5
60-
"go.toolsEnvVars": {
61-
"GOFLAGS": "-tags=<yourtag>"
62-
}
63-
```
50+
build tags and flags will be automatically picked up from `"go.buildTags"` and `"go.buildFlags"` settings. In rare cases if you don't want the default behavior, you can still override the settings from the `gopls` section, using `"gopls": { "build.buildFlags": [] }`.
6451

6552

6653
[VSCode-Go]: https://github.com/golang/vscode-go

0 commit comments

Comments
 (0)