You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gopls/doc/vscode.md
+9-22Lines changed: 9 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -19,22 +19,15 @@ Use the [VSCode-Go] plugin, with the following configuration:
19
19
},
20
20
},
21
21
"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,
24
24
25
25
// If true, enable additional analyses with staticcheck.
26
26
// 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
38
31
}
39
32
```
40
33
@@ -44,23 +37,17 @@ To enable more detailed debug information, add the following to your VSCode sett
44
37
"go.languageServerFlags": [
45
38
"-rpc.trace", // for more detailed debug logging
46
39
"serve",
47
-
"--debug=localhost:6060", // to investigate memory usage, see profiles
40
+
"--debug=localhost:6060", //Optional: to investigate memory usage, see profiles
48
41
],
49
42
```
50
43
51
44
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.
52
45
53
46
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.
54
47
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
58
49
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": [] }`.
0 commit comments