-
Notifications
You must be signed in to change notification settings - Fork 763
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
formatting: option to wrap long lines #847
Comments
Thanks for the report. |
@stamblerre Is there an option to disable gopls's formatting support? As discussed in microsoft/vscode#72315 and microsoft/vscode#41882 at length, multiple formatters from the same extension is not recommended. 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 |
Would it be possible to apply additional formatting in the language client's middleware? |
@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? What other formatters do users want to use? |
There is
I honestly wasn't aware of |
BTW, golines lets you use a base formatter (such as gofumports) (so I'm using run on save here):
Note: after 0.1.0 release, gofumpt will include gofumports by default so the above will need to change to |
You can now setting |
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: