microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.16k stars 28.54k forks source link

Classify setting.json into several categories #165313

Closed xuestrange closed 1 year ago

xuestrange commented 1 year ago

The setting.json seems messy

{
  "git.decorations.enabled": true,
  "explorer.decorations.badges": true,
  "explorer.decorations.colors": true,
  "extensions.autoUpdate": true,
  "latex-workshop.bibtex-format.sort.enabled": true,
  "notebook.showFoldingControls": "always",
  "explorer.confirmDragAndDrop": false,
  "grunt.autoDetect": "on",
  "http.proxy": "http://127.0.0.1:7890",
  "ipynb.experimental.pasteImages.enabled": true,
  "r.rterm.windows": "C:\\Users\\XJZ\\Miniconda3\\Scripts\\radian.exe",
  "r.lsp.debug": true,
  "security.workspace.trust.untrustedFiles": "open",
  "r.lsp.use_stdio": true,
  "debug.onTaskErrors": "showErrors",
  "explorer.confirmDelete": false,
  "ltex.completionEnabled": true,
  "ltex.enabled": [
    "latex",
    "markdown"
  ],
  "ltex.statusBarItem": true,
  "workbench.colorTheme": "GitHub Dark Default",
  "window.commandCenter": true
}

What if classify the setting.json into several categories and format it?

{
  /* ------------------------ debug ----------------------- */
  "debug.console.fontSize": 18,
  "debug.toolBarLocation": "docked",
  "debug.console.acceptSuggestionOnEnter": "on",
  /* ------------------- editor setting ------------------- */
  "editor.unusualLineTerminators": "off",
  "editor.acceptSuggestionOnCommitCharacter": false,
  "editor.autoClosingBrackets": "languageDefined",
  "editor.bracketPairColorization.enabled": true,
  "editor.codeLens": false,
  /* ------------------------- git ------------------------ */
  "git.autoRepositoryDetection": true,
  "git.autorefresh": true,
  "git.confirmSync": false,
  /* ------------------------ latex ----------------------- */
  "latex-workshop.linting.run": "onType",
  "latex-workshop.hover.citation.enabled": true,
  "latex-workshop.hover.preview.enabled": true
}

It would be convenient to change setting if setting.json is welll-formatted. I hope there exists a tool / extension / command to auto-format it.

DEXTER251 commented 1 year ago

comments of the form //… or // are not allowed in JSON

aeschli commented 1 year ago

That's a good idea for an extension.

Our focus is on the Settings UI.

VSCodeTriageBot commented 1 year ago

We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the VS Code Marketplace. Just in case, in a few simple steps you can get started writing your own extension. See also our issue reporting guidelines.

Happy Coding!