-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: reverting files after formatting #34423
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
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting section of the gopls Wiki page, and make sure that you have provided all of the relevant information here. |
I'm sorry you're experiencing this issue; this definitely shouldn't happen. What editor are you using |
Also, can you share your |
Thank you very much for your enthusiastic and positive reply. Just before the bug appeared, my operation is ctrl+x cutting a line, then pressing ctrl+s, then the code is messed up. Initial code
Code after ctrl + x
Code after ctrl + s
PS D:\source\gopath\src\rtc-api> gopls -debug Usage: gopls [flags] [command-flags] [command-args] Available commands are:
-listen string Please answer these questions before submitting your issue. Thanks! What did you do?If possible, provide a recipe for reproducing the error. What did you expect to see?set GOFLAGS=
{
|
Can you share your "[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
}
} |
@stamblerre
reference: https://fullstack.love/achieve/21 |
The problem still appears,Is this the log you expect to see? I guess because I didn't use the go module, but gopls seems to be the go module mode. If things are really like what I guess, how can I solve it? before ctrl + s
after ctrl +s
vscode settings.jso
|
It looks like you have disabled the formatting feature from To get full logs from "go.languageServerFlags": [
"-rpc.trace", // for more detailed debug logging
"serve",
], Then find the logs, by going to View -> Output -> Tasks -> gopls. |
Duplicate of #34955 |
Let's move the discussion of this issue to #34955, as I'm hoping to consolidate all of the error reports from users experiencing this issue. Please follow the suggestions in that issue. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What did you do?
x/tools/gopls makes me painful.
I recently updated this package. I often can't save the code.
Sometimes, When I delete some code, after pressing ctrl +s, those extra codes will appear again.
I don't know if the description is clear,
if there are other people who have encountered it.
In short, this is a painful experience.
What did you expect to see?
When I press ctrl +s, I can save the code automatically.
What did you see instead?
When I delete some code, after pressing ctrl +s, those extra codes will appear again.
The text was updated successfully, but these errors were encountered: