0

I was trying out the customizations from this post ( Change highlight text color in Visual Studio Code) but it broke my VS Code settings.json.

I followed the first answer, the highlighting now works.

But when I click on the top to bring up the "Menu Bar", I get the message:

Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.

{
  "workbench.colorTheme": "One Monokai",
  "security.workspace.trust.untrustedFiles": "open",
  "files.autoSave": "afterDelay",
  "editor.minimap.enabled": false,
  "editor.wordWrap": "on",
  "window.commandCenter": false,
  "workbench.layoutControl.enabled": false,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "editor.tabSize": 2,
  "editor.mouseWheelZoom": true,
  "html.hover.references": false,
  "css.hover.references": false,
  "less.hover.references": false,
  "scss.hover.references": false,
  "window.menuBarVisibility": "compact",
  "window.zoomLevel": 1,
  "editor.tokenColorCustomizations": {
  },
  "workbench.colorCustomizations": {
    "editor.selectionBackground": "#e788ff7c",
    "editor.selectionHighlightBackground": "#ff00005b",
    "editor.selectionHighlightBorder": "#fbf300e0", ##border when you select
    "editor.findMatchBackground": "#f352fe8f",
    "editor.findMatchHighlightBackground": "#8e52fe9e",
    "editor.findMatchHighlightBorder": "#fbf300e0" ##border when you search for something
  }
}

I'm not sure what should I do to fix this issue.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135

1 Answers1

0

Comments should start with //, not with ##.

VS Code's settings.json follows JSON with Comments (jsonc) mode:
https://code.visualstudio.com/docs/languages/json#_json-with-comments

In addition to the default JSON mode following the JSON specification, VS Code also has a JSON with Comments (jsonc) mode. This mode is used for the VS Code configuration files such as settings.json, tasks.json, or launch.json. When in the JSON with Comments mode, you can use single line (//) as well as block comments (/* */) as used in JavaScript.

In addition, the editor should have shown you that something was wrong.

screenshot of VS Code with both the valid and the invalid comments

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135