Visual Studio Code: How to Disable `editor.codeActionsOnSave`

Viewed 10641

I find that the editor.codeActionsOnSave configuration very annoying because a lot of times when I save, it eats up some time getting some code actions for the language I'm currently using (Golang, for example).

I have no desire nor need for such a feature as I have configured my desired actions upon save elsewhere.

I have already added the following entries on my VS Code configuration file:

"editor.codeActionsOnSave": {},
"[go]": {
    "editor.codeActionsOnSave": {}
},

However, setting an empty value does not seem to disable this annoying feature because I still get popups that VS Code is getting some code actions.

Previously, editor.codeActionsOnSave was set to null by default, but this also does not disable the feature.

How do I disable this feature?

EDIT: I also filed a GitHub issue about this here.

2 Answers

You can delete it or set it to false

...
  "editor.codeActionsOnSave": {
    "source.fixAll": false,
    "source.organizeImports": false
  },
  "editor.formatOnSave": false
...

I managed to get rid of it by setting it only for go :

"[go]": {
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
      "source.fixAll": true,
      "source.organizeImports": true
  }
}

Setting it to null does not work, somehow Go expects it to be set up, and setting it to false globally can be a pain on other projets (I am looking at you react-native project with eslint set up)

Related