-
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: separate imports from formatting #30843
Comments
I was actually a little surprised to find this, since the wiki as of today mentions, in the context of configuration with
I understood that to mean that results from Am I mis-reading this issue or the wiki configuration example (or both)? If so, would you be able to give some more direction about the expected way to get the imports to be fixed via calls from an FWIW, I did trace the |
The wiki is a little confusing, it is saying that gopls does the same work that gofmt and goimports do, so there is no need to run them any more. It will do the work of those two tools when you save the document with the settings we suggest, but it does it through two very different code paths (the formatting call and a codeAction) |
Thanks for the quick reply and clarification. It's possible that there is still a problem, but I'll file it as a separate issue. |
Change https://golang.org/cl/204557 mentions this issue: |
The above change stops formatting for a file that has no import modifications, but a file will still be formatted if we are adding or deleting imports. |
Updates golang/go#30843 Updates golang/go#35114 Change-Id: Id3f66d20b1ada9e53298b2370214b23b87bb0680 Reviewed-on: https://go-review.googlesource.com/c/tools/+/204557 Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Cottrell <[email protected]>
Change https://golang.org/cl/205678 mentions this issue: |
LSP has a separation between formatting a document and organizing imports (the code action "source.organizeImports"). We should follow this by only returning diffs of the import block when we return results from goimports.
/cc @ramya-rao-a
The text was updated successfully, but these errors were encountered: