golang / vscode-go

Go extension for Visual Studio Code

Home Page:https://marketplace.visualstudio.com/items?itemName=golang.Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrap long lines using golines

sjackman opened this issue · comments

Is your feature request related to a problem? Please describe.
I'd like to wrap long lines.

Describe the solution you'd like
I'd like to wrap long lines using golines when I save a file.

Describe alternatives you've considered

Additional context
On 2021-04-09 in #847 (comment), @stamblerre wrote…

You can now setting "go.formatTool": "golines" and it will work together with gopls. Closing.

but when I set this configuration option go.formatTool": "golines, I get the error message:
Value is not accepted. Valid values: "default", "gofmt", "goimports", "goformat", "gofumpt", "custom".

    "go.formatTool": "custom",
    "go.alternateTools": {
        "customFormatter": "golines" <--- or exact path like "~/go/bin/golines". 
    }
}

Nice! Thank you for the quick and helpful response, @hyangah! 😁