VS Code settings.json File Corrupted. Can I Recover a Default settings.json?

First, thank you to all who responded to my post introducing myself. It was a kind and warm welcome. Thank you.

The t-shirt I’m wearing today proclaims: “Pretty sure I seized the wrong day”. It is appropriate as I have shot myself in the foot repeatedly today.

In trying to open an HTML file, I get an error in VS Code saying “Unable to sync settings because the content in the file is not valid.” I fear that I corrupted this file when I tried to add an extension, Colorful Comments.

When I found the extension I was able to use the VS Code widgets to install it, but it didn’t change the display color of my comments as I expected. In scrolling through information provided by the author, I found a place that had a link to the settings.json file. Having no explicit instructions, I presumed (a bad mistake I make far too often) that I was supposed to copy and paste all the settings for Colorful-comments: tabs that were provided. I copied and slipped up when I pasted them and managed to corrupt the default settings.json entries.

Is there a way to down load a fresh copy of the VS Code settings.json file and install it? I’ve done some searching and found nothing that I understand. Rather than make things worse, I thought I’d ask for advice.

TIA

I assume that you use Windows. I asked copilot (I am not using Windows, so I have no clue)

Alternatively, if you want to fully reset your settings, you can delete the settings.json file located at:

  • Windows: %APPDATA%\Code\User\settings.json
  • macOS: $HOME/Library/Application Support/Code/User/settings.json
  • Linux: $HOME/.config/Code/User/settings.json

After deleting it, VS Code will generate a fresh settings.json file when restarted.

Thanks for the response.

I think I resolved the problem; although I can’t be certain. I found and deleted the settings.json file in %APPDATA% then reloaded VS Code. It seems to be working now.

1 Like

There are several settings files. The main 2 are User and workspace settings. That documentation also describes how to use the Settings editor. There are also Extension settings.