2
votes

I have VSCode configurated for formatting on saving and also configured for auto-saving after delay like the following snippet

{
   ...
   "editor.formatOnSave": true,
   "files.autoSave": "afterDelay",
   "files.autoSaveDelay": 1000,
   ...
}

But, it does not format when auto-saving, only if I explicitly save using control+S

How can I get it to do it automatically?

1

1 Answers

1
votes

I don't believe this is currently possible See this thread for further discussion.

Edit: As yehonatan pointed out, this is now possible with the use of extensions. There are two extensions suggested in the thread I originally linked:

  1. Run on Save
  2. Format on auto save

Both require adding a bit of configuration to your settings.json, check out the thread for info on that.