-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
x/tools/gopls: organize imports formats the package statement #63153
Comments
Upon further investigation, it turns out that the bulk of the formatting is indeed turned off, but it is the extra spaces between words that are still removed for some reason (as in the |
This looks like a dupe of golang/vscode-go#2268, which is still not resolved. Interestingly, I apparently couldn't reproduce that issue, but do reproduce it now. @hyangah this looks like a VS Code issue: the extension is setting a formatting request to gopls. |
I think this is actually the result of a formatting from Can you try turning off organize imports on save to confirm this is where the bug is?
|
Confirmed. |
Transferred to the gopls issue tracker for the organize imports bug. |
Any progress? The proposed fixes don't work for me. The only thing that does is disabling the language server altogether |
@abel1502 you mean the the fixes in #63153 (comment) does not turn off auto-formatting for you? Can you share the full contents of your |
@findleyr Sorry, after fruitlessly fiddling with it for a while I eventually gave up and removed all of my attempted modifications. By now I think I'm used to this behaviour... Neat brainwashing setup you've got, it turns out) |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Describe the bug
Disabling format on save is not possible without disabling gopls altogether.
Steps to reproduce the behavior:
package main
The text was updated successfully, but these errors were encountered: