Skip to content

Commit

Permalink
gopls: add note to vscode doc about tags
Browse files Browse the repository at this point in the history
As prompted [this issue](golang/go#38963) it
is unclear how to setup build tags in gopls in vscode.

vscode has a configuration section specific for go build tags but it is
not honored by gopls which instead requires GOFLAGS environment variable
to be set with the -tags flag.

Change-Id: Ib74a5bca78bf222d73224590ee0344948f020f9f
GitHub-Last-Rev: 37d1f9f
GitHub-Pull-Request: #227
Reviewed-on: https://go-review.googlesource.com/c/tools/+/233018
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
  • Loading branch information
perrito666 authored and stamblerre committed May 8, 2020
1 parent 9b82503 commit 2d0106b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gopls/doc/vscode.md
Expand Up @@ -52,6 +52,16 @@ See the section on [command line](command-line.md) arguments for more informatio

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.

### Build tags

build tags will not be picked from `go.buildTags` configuration section, instead they should be specified as part of the`GOFLAGS` environment variable:

```json5
"go.toolsEnvVars": {
"GOFLAGS": "-tags=<yourtag>"
}
```


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

Expand Down

0 comments on commit 2d0106b

Please sign in to comment.