Skip to content

Commit 05edb9c

Browse files
committed
package.json: clean up formatter setting
Users can specify custom formatter. Change-Id: Ia60c75682009125c1ec562e696848b265285c0ef Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/416614 Reviewed-by: Suzy Mueller <[email protected]> Reviewed-by: Jamal Carvalho <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]>
1 parent b9472fc commit 05edb9c

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

docs/settings.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,8 @@ Default:
223223
Flags to pass to format tool (e.g. ["-s"]). Not applicable when using the language server.
224224
### `go.formatTool`
225225

226-
Not applicable when using the language server. Choosing 'goimports', 'goreturns', or 'gofumports' will add missing imports and remove unused imports.<br/>
227-
Allowed Options:
228-
229-
* `default`: If the language server is enabled, format via the language server, which already supports gofmt, goimports, goreturns, and gofumpt. Otherwise, goimports.
230-
* `gofmt`: Formats the file according to the standard Go style.
231-
* `goimports`: Organizes imports and formats the file with gofmt.
232-
* `goformat`: Configurable gofmt, see https://github.com/mbenkmann/goformat.
233-
* `gofumpt`: Stricter version of gofmt, see https://github.com/mvdan/gofumpt.
234-
* `gofumports`: Applies gofumpt formatting and organizes imports.
235-
226+
When the language server is enabled and one of default/gofmt/goimports/gofumpt is chosen, the language server will handle formatting. Otherwise, the extension will use the specified tool for formatting.<br/>
227+
Allowed Options: `default`, `gofmt`, `goimports`, `goformat`, `gofumpt`
236228

237229
Default: `"default"`
238230
### `go.generateTestsFlags`

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,22 +1194,22 @@
11941194
"go.formatTool": {
11951195
"type": "string",
11961196
"default": "default",
1197-
"description": "Not applicable when using the language server. Choosing 'goimports', 'goreturns', or 'gofumports' will add missing imports and remove unused imports.",
1197+
"description": "When the language server is enabled and one of default/gofmt/goimports/gofumpt is chosen, the language server will handle formatting. Otherwise, the extension will use the specified tool for formatting.",
11981198
"scope": "resource",
11991199
"enum": [
12001200
"default",
12011201
"gofmt",
12021202
"goimports",
12031203
"goformat",
1204-
"gofumpt",
1205-
"gofumports"
1204+
"gofumpt"
12061205
],
1206+
"additionalItems": true,
12071207
"enumDescriptions": [
12081208
"If the language server is enabled, format via the language server, which already supports gofmt, goimports, goreturns, and gofumpt. Otherwise, goimports.",
1209-
"Formats the file according to the standard Go style.",
1210-
"Organizes imports and formats the file with gofmt.",
1209+
"Formats the file according to the standard Go style. (not applicable when the language server is enabled)",
1210+
"Organizes imports and formats the file with gofmt. (not applicable when the language server is enabled)",
12111211
"Configurable gofmt, see https://github.com/mbenkmann/goformat.",
1212-
"Stricter version of gofmt, see https://github.com/mvdan/gofumpt.",
1212+
"Stricter version of gofmt, see https://github.com/mvdan/gofumpt. (not applicable when the language server is enabled)",
12131213
"Applies gofumpt formatting and organizes imports."
12141214
]
12151215
},

0 commit comments

Comments
 (0)