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
Recent changes removed the option to prevent gopls from formatting code in the context of VS Code: mvdan/gofumpt#83
gofumpt is specially being integrated into gopls, but this leaves users of other tools like https://github.com/segmentio/golines out in the cold now having to choose between better in-editor diagnostics or code formatting.
I (at least) am not particular about how long lines are automatically wrapped, so if you aren't interested in adding an option to wrap lines perhaps bringing back options that would allow golines to coexist with gopls would be great.
The text was updated successfully, but these errors were encountered:
Thanks for the report. gopls doesn't currently support any custom formatters apart from gofumpt yet, and it's not likely that we will add support for this in the near future. Transferring to the VS Code Go repo in case @hyangah has alternative ideas for supporting custom formatters in VS Code Go.
I am not sure how many other formatters out there - is there any other formatter to consider?
Re: golines - as discussed in slack, most of formatting decisions golines makes do not follow Go best practice while a couple of them are still something to consider. For example, wrapping long case lists, long comments could be handy and not be too far off of Go best practice if offered as code action or commands.
@stamblerre We can intercept all the formatting requests and not forwarding the requests. Given that most of alternative formatters will run the default gofmt, I don't see a value of forwarding or post processing the requests.
I fear we need to add an additional setting to override gopls's feature. Or is there any existing setting we can reference?