-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/tools/gopls: convert 'gofumpt' from formatter to code action provider #39805
Comments
If people want to use gofumpt, wouldn't an option to use gofumpt for formatting be more useful than suggested fixes? |
The suggested fixes would be categorized as "source.fixAll", which is a code action kind indicating that these are high-confidence fixes that can be applied on save. We already have similar analyzers and fixes for |
I see, I knew I was missing something! |
Change https://golang.org/cl/241985 mentions this issue: |
Reopened this, as we've only added opt-in support for |
Add an analyzer that produces suggested fixes using https://pkg.go.dev/mvdan.cc/gofumpt/format?tab=doc.
The tricky part is that the dependency will have to live in the
gopls
module, since it's not agolang.org/x/...
dependency. That means the analyzer will have to be in that module, and we won't be able to have any internal/lsp tests for this behavior until #35880 is resolved./cc @joshbaum @mvdan
The text was updated successfully, but these errors were encountered: