10

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.

1
  • 1
    It is only set to null by default if you clicked "edit in settings.json" but then did nothing when the editor was shown. Commented Apr 21, 2021 at 6:46

2 Answers 2

6

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)

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, I'll give it a try! Although since I'm not working in Go at the moment, it could take a while before I can observe whether it works on my side and accept it as the answer. Many thanks for answering!
this worked for me! and it's a better answer than the other one that has more votes, because the "[go]": {} block is essential!
6

You can delete it or set it to false

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

3 Comments

Hmm, this looks very promising! I'll try it out and accept this as the answer if it works after observing it for a while. But is "editor.formatOnSave": false really mandatory? I find that format on save is very useful.
UPDATE: Sadly, this didn't work for me. :( I have no idea what code action VS Code is even doing for Golang because I don't have any specified. Many thanks for trying, though! :)
None of these are mandatory. As said you can even delete them completely. Sorry it didn't work for you :(

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.