-
Notifications
You must be signed in to change notification settings - Fork 18k
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: changes reverted after saving #32643
Comments
Can you share a |
This is CTRL+S (focus) and auto removal log.
And this is autocomplete record:
|
@gencer: What is the output of running |
I've installed via:
Isn't this supposed to install latest version? Am I missing something? |
Yes, it does. Thanks for confirming - I just wanted to be certain because your logs were missing the version information that |
Do you have both of these settings enabled? "editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
} Can you disable one at a time? I'd like to see if this a problem coming from formatting or from import organization. |
Ah, That's my mistake. I've trimmed them :(. Sorry! I can send whole log again if you want.
Yes, This is my whole go-specific settings:
Trying now. |
Okay. Definitely this one:
import didn't changed anything, however disabling this solved. |
Don't worry about the logs - it totally makes sense to trim them. Thank you for the information. Formatting works on ASTs whereas organizing imports work on a file's contents. It seems like we must be using an old AST when formatting. I will continue to investigate this, but for now, disabling that setting should be enough to fix the issue (organizing imports also formats the file). To clarify, the suggested workaround for handling this issue is configuring this setting to be false: "[go]": {
"editor.formatOnSave": false
}, |
Yes, that'd be easiest. And if you could include fresh logs that would also be great, just so we can separate the two issues. |
Done it. #32654 |
@gencer: Can you update to the most recent version of |
This seems to be fixed in |
Great thank you. Closing this issue then. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Windows 10 1903 x64 uses Ryzen 3 processor.
go env
OutputWhat did you do?
Open project and play with it. Just edit and save the document. When saved, all changes will be lost and revert back to first state. Also this happens when I right-click. Probably after loosing focus.
What did you expect to see?
Just want to see suggestions (autocomplete) and keep my changes. But this is not working at all. Worst experience in VSCode.
What did you see instead?
Changes get lost after loosing focus or save, autocomplete barely working.
Focus/Save issue:
Autocomplete issue:
req
barely completes. Above works below not. Most of my code is like this.The text was updated successfully, but these errors were encountered: