Skip to content

Allow specifying random formatting tools instead of four fixed options #587

Closed
@xabinapal

Description

@xabinapal

Is your feature request related to a problem? Please describe.
Current extension settings only allow to select gofmt, goimports, goreturns and goformat as formatters. There are other formatting tools that one would want to use, but this is not allowed.

Describe the solution you'd like
gofumpts and gofumports are two known alternatives to gofmt and goimports. It would be nice to be allowed to use them, or any other formatter tool. This should be allowed by using a textbox instead of a selector for this property, with maybe suggestions for the current options.

Describe alternatives you've considered
As a workaround, manually modifying the property go.formatTool in the settings.json file allows to use gofumports as the formatting tool. By doing this, VS Code complains about an invalid value for that setting, but even with that warning, gofumports is used and code is formatted as expected.

Additional context
gopls just added support for gofumpts, so it can used by enabling it in the language server (with some undocumented settings, but this is already stated in it's documentation), but not everybody can use it, so it would be nice to add this feature.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions