question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't format Settings.json file

See original GitHub issue

VS Code Version: 1.39.2

Prettier & Prettier Plugin Version: 3.2.0 using built in Prettier

OS and version: Centos 8

@ntotten I have the output open and when I get the error nothing changes, it does not get to the output. I simply change:

  "[jsonc]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },

to:

  "[jsonc]": {
    "editor.defaultFormatter": "prettier.prettier-vscode"
  },

and hit save. I now get a VS Code message appear, not the normal one on the right, but a smaller on on the left that says: (click to zoom) prettier-error

and the file that won’t work:

// Place your settings in this file to overwrite the default settings
{
  // VS Code 1.39
  // General settings
  "editor.fontSize": 15,
  "editor.renderWhitespace": "boundary",
  "editor.dragAndDrop": false,
  "editor.formatOnSave": true,
  "editor.minimap.enabled": false,
  "editor.detectIndentation": false,
  "editor.tabSize": 2,
  "editor.codeActionsOnSave": {
    "source.organizeImports": true
  },
  "workbench.activityBar.visible": false,
  "workbench.tree.renderIndentGuides": "none",
  "workbench.list.keyboardNavigation": "filter",
  "window.menuBarVisibility": "hidden",
  "window.enableMenuBarMnemonics": false,
  "window.titleBarStyle": "custom",
  "zenMode.restore": true,
  "zenMode.centerLayout": false,
  "zenMode.fullScreen": false,
  "git.autofetch": true,
  "git.enableSmartCommit": true,
  "git.decorations.enabled": false,
  "explorer.decorations.colors": false,
  "search.followSymlinks": false,
  "breadcrumbs.enabled": false,
  "markdown.preview.fontSize": 15,
  "terminal.integrated.fontSize": 15,
  // Privacy
  "telemetry.enableTelemetry": false,
  "extensions.showRecommendationsOnlyOnDemand": true,
  // Language settings
  "javascript.preferences.quoteStyle": "single",
  "typescript.updateImportsOnFileMove.enabled": "always",
  "files.exclude": {
    "**/*.js": {
      "when": "$(basename).ts"
    },
    "**/*.js.map": true
  },
  "[javascript]": {
    "editor.defaultFormatter": "prettier.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "prettier.prettier-vscode"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "prettier.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "prettier.prettier-vscode"
  },
  "[html]": {
    "editor.defaultFormatter": "prettier.prettier-vscode"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "prettier.prettier-vscode"
  },
  // Shell Format extension
  "shellformat.flag": "-i 4",
  // Live Server extension
  "liveServer.settings.donotShowInfoMsg": true,
  "liveServer.settings.ChromeDebuggingAttachment": true,
  "liveServer.settings.AdvanceCustomBrowserCmdLine": "/usr/bin/chromium-browser --remote-debugging-port=9222",
  // Spellright extension
  "spellright.language": [
    "English (British)"
  ],
  "spellright.documentTypes": [
    "markdown",
    "latex",
    "plaintext"
  ],
  // Markdown Preview Enhanced extension
  "markdown-preview-enhanced.usePandocParser": true,
  // "typescript.referencesCodeLens.enabled": true,
  // "javascript.referencesCodeLens.enabled": true,
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
ntottencommented, Nov 18, 2019

So is this only an issue with that one file? If so, I think we can close this issue.

1reaction
CiGitcommented, Nov 12, 2019

By opening global settings $HOME/.config/Code/Users/settings.json through Preferences: Open settings (JSON) I get that status bar error message. This doesn’t happen if the file is opened as a normal file. Neither by opening project settings (.vscode/settings.json)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't format user settings.json in vscode · Issue #911 - GitHub
When the option "editor.defaultFormatter": "esbenp.prettier-vscode" in user settings is set is set, one cannot format the settings.json file ...
Read more >
prettier-vscode is configured as formatter but it cannot format ...
I'm unable to use prettier-vscode as a formatter for JSON files. It seems the extension does not register it as a valid default...
Read more >
User and Workspace Settings - Visual Studio Code
You can open the settings.json file with the Preferences: Open Settings (JSON) command in the Command Palette (Ctrl+Shift+P).
Read more >
VSCode settings.json | vs code settings.json - YouTube
0:00 How to open settings. json in VSCode? 0:10 Hit Ctrl + , (comma) 0:20 Type settings. json in search settings box …...
Read more >
How to Customize Visual Studio Code Settings.json - YouTube
Your browser can't play this video. Learn more. Switch camera ... Then we will take a deep dive into my settings. json config....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found