-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: add new formatter gorgeous #2503
Comments
Change https://go.dev/cl/446298 mentions this issue: |
@hidu Custom formatter support had been available since v0.24.0, but this extension assumes the formatter can work with the input supplied with STDIN, and output to STDOUT. I am not familiar with the I prepared a change that made this feature more visible. If it's merged in in the current state and your tool supports STDIN/STDOUT, users may enable it like
|
Custom formatter support was added in #1238. But due to the limitation in the VS Code setting UI (which assumes the acceptable values list is static) and the setting validation logic (VS Code thinks it's an error to use a value outside of the supplied enum list is invalid), this is not visible to users. Instead, this change introduces an extra enum 'custom' for the "go.formatTool" setting. If this is chosen, the extension uses the tool specified as `customFormatter` in the "go.alternateTools" setting section for formatting. The extension expects the custom formatter to accept input as STDIN and output the result as STDOUT. Users can also supply "go.formatFlags". Changed the descriptions to use markdown - which allows to reference other settings ("`#...#`"). The document generation tool does not handle this special syntax nicely but I hope this isn't too confusing. I wish we could add an extra validation on the allowed value for "go.formatTool" in favor of this new 'custom' option. I am not adding the validation in this CL because there could be users who depend on this behavior. For #1238 For #1603 For #2503 Change-Id: I5d9564f331845b6b07f0b54148834118404f3553 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/446298 Reviewed-by: Jamal Carvalho <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]>
The new setting tweak will be available in the next release. Until then, use |
Is your feature request related to a problem? Please describe.
gorgeous
is a new powerful formatter.Project is: https://github.com/fsgo/go_fmt
Describe the solution you'd like
Add it to "Format Tool" option.
or "Format Tool" can set any other customized tool, rather than the limited ones.
The text was updated successfully, but these errors were encountered: