9

When I save file, VSCode auto cleans the not used code, How to Disable it? I want to make VSCode not to delete any line of my code.

enter image description here

Qwerty
  • 29,062
  • 22
  • 108
  • 136
yu yang Jian
  • 6,680
  • 7
  • 55
  • 80

2 Answers2

1

Go to Visual Studio Code's settings page in JSON format then remove the line

"source.fixAll": true,

this line you will find inside of this object

"editor.codeActionsOnSave": {

},
-3

After finding and testing, it can be configured at Workspace Settings > Go configurartion, override "go.formatOnSave": false, on the right side, disable formatting then the code will not be auto cleaned.

enter image description here

EDIT: Later then I meet this issue .

yu yang Jian
  • 6,680
  • 7
  • 55
  • 80