-
Notifications
You must be signed in to change notification settings - Fork 819
-
I installed the official go extension in VS Code all the necessary executables are installed, the problem is when I am writing my code their is this weird thing that deletes my code all the time and I cannot stop it....
gopls.mp4
I think its something to do with the settings but I don't know how to set them.... 🥵
Beta Was this translation helpful? Give feedback.
All reactions
Deleting unused imports is the default behavior to help saved files can compile - In Go, unused imports are compile-time errors.
For different behavior, follow the instruction in "Formatting Code and Organizing Imports".
"[go]": { "editor.codeActionsOnSave": { "source.organizeImports": false }}
Replies: 1 comment 2 replies
-
Deleting unused imports is the default behavior to help saved files can compile - In Go, unused imports are compile-time errors.
For different behavior, follow the instruction in "Formatting Code and Organizing Imports".
"[go]": { "editor.codeActionsOnSave": { "source.organizeImports": false }}
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 3
-
why it's enabled by default., i really dont get it. like it's not a bug it is a feature. however it only golang extension enforces it
Beta Was this translation helpful? Give feedback.
All reactions
-
Wouldn't it be better to simply comment out the unused imports rather than deleting them?
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 4