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
src/goLanguageServer: propagate go.buildFlags,buildTags to gopls
They are passed as gopls.buildFlags only if gopls.buildFlags isn't
already explicitly set - users have to use JSON-based UI and add
the fields (including []).
If go.buildFlags has -tags, go.buildTags is ignored, which is
consistent with the extension's build behavior coded in goBuild
(goBuild.ts).
For #155
Change-Id: I03d5f5eb58d049454fb4a66d902a7daea4a1269f
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/273146
Trust: Hyang-Ah Hana Kim <[email protected]>
Trust: Suzy Mueller <[email protected]>
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
Copy file name to clipboardExpand all lines: docs/settings.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ Default: `false`
79
79
80
80
### `go.buildFlags`
81
81
82
-
Flags to `go build`/`go test` used during build-on-save or running tests. (e.g. ["-ldflags='-s'"])
82
+
Flags to `go build`/`go test` used during build-on-save or running tests. (e.g. ["-ldflags='-s'"]) This is propagated to the language server if `gopls.buildFlags` is not specified.
83
83
84
84
### `go.buildOnSave`
85
85
@@ -91,7 +91,7 @@ Default: `package`
91
91
92
92
### `go.buildTags`
93
93
94
-
The Go build tags to use for all commands, that support a `-tags '...'` argument. When running tests, go.testTags will be used instead if it was set.
94
+
The Go build tags to use for all commands, that support a `-tags '...'` argument. When running tests, go.testTags will be used instead if it was set. This is propagated to the language server if `gopls.buildFlags` is not specified.
95
95
96
96
Default: ``
97
97
@@ -617,6 +617,8 @@ buildFlags is the set of flags passed on to the build system when invoked.
617
617
It is applied to queries like `go list`, which is used when discovering files.
618
618
The most common use is to set `-tags`.
619
619
620
+
If unspecified, values of `go.buildFlags, go.buildTags` will be propagated.
621
+
620
622
621
623
#### `codelenses`
622
624
codelenses overrides the enabled/disabled state of code lenses. See the "Code Lenses"
@@ -626,7 +628,7 @@ Example Usage:
626
628
```json5
627
629
"gopls": {
628
630
...
629
-
"codelenses": {
631
+
"codelens": {
630
632
"generate":false, // Don't show the `go generate` lens.
631
633
"gc_details":true// Show a code lens toggling the display of gc's choices.
Copy file name to clipboardExpand all lines: package.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1222,13 +1222,13 @@
1222
1222
"type": "string"
1223
1223
},
1224
1224
"default": [],
1225
-
"description": "Flags to `go build`/`go test` used during build-on-save or running tests. (e.g. [\"-ldflags='-s'\"])",
1225
+
"description": "Flags to `go build`/`go test` used during build-on-save or running tests. (e.g. [\"-ldflags='-s'\"]) This is propagated to the language server if `gopls.buildFlags` is not specified.",
1226
1226
"scope": "resource"
1227
1227
},
1228
1228
"go.buildTags": {
1229
1229
"type": "string",
1230
1230
"default": "",
1231
-
"description": "The Go build tags to use for all commands, that support a `-tags '...'` argument. When running tests, go.testTags will be used instead if it was set.",
1231
+
"description": "The Go build tags to use for all commands, that support a `-tags '...'` argument. When running tests, go.testTags will be used instead if it was set. This is propagated to the language server if `gopls.buildFlags` is not specified.",
1232
1232
"scope": "resource"
1233
1233
},
1234
1234
"go.testTags": {
@@ -2068,7 +2068,7 @@
2068
2068
"properties": {
2069
2069
"buildFlags": {
2070
2070
"type": "array",
2071
-
"markdownDescription": "buildFlags is the set of flags passed on to the build system when invoked.\nIt is applied to queries like `go list`, which is used when discovering files.\nThe most common use is to set `-tags`.\n",
2071
+
"markdownDescription": "buildFlags is the set of flags passed on to the build system when invoked.\nIt is applied to queries like `go list`, which is used when discovering files.\nThe most common use is to set `-tags`.\n\nIf unspecified, values of `go.buildFlags, go.buildTags` will be propagated.\n",
2072
2072
"default": [],
2073
2073
"scope": "resource"
2074
2074
},
@@ -2130,7 +2130,7 @@
2130
2130
},
2131
2131
"codelenses": {
2132
2132
"type": "object",
2133
-
"markdownDescription": "codelenses overrides the enabled/disabled state of code lenses. See the \"Code Lenses\"\nsection of settings.md for the list of supported lenses.\n\nExample Usage:\n```json5\n\"gopls\": {\n...\n\"codelenses\": {\n\"generate\": false, // Don't show the `go generate` lens.\n\"gc_details\": true // Show a code lens toggling the display of gc's choices.\n }\n...\n}\n```\n",
2133
+
"markdownDescription": "codelenses overrides the enabled/disabled state of code lenses. See the \"Code Lenses\"\nsection of settings.md for the list of supported lenses.\n\nExample Usage:\n```json5\n\"gopls\": {\n...\n\"codelens\": {\n\"generate\": false, // Don't show the `go generate` lens.\n\"gc_details\": true // Show a code lens toggling the display of gc's choices.\n }\n...\n}\n```\n",
0 commit comments