PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 23, 2022

[FIXED] How do I control the formatting style of JSON in Visual Studio Code?

 July 23, 2022     json, visual-studio-code     No comments   

Issue

There is apparently built in support in VS Code to format JSON files. However, I do not see a way to customize the way the formatting is done (e.g. specifying line breaks before curly-braces, brackets, etc). I have also read some documentation related to this but it doesn't go into any detail. Is there a way to customize how the formatting works in Visual Studio Code for JSON files?


Solution

Default formatter of JSON have only few features, like changing tab size.

Open Preferences with File > Preferences > Settings (Ctrl + ,) > User Settings (or Workspace Settings) tab > [JSON] "Edit in settings.json" link

or

Command Palette (Ctrl+Shift+P) > Preferences: Configure Language Specific Settings > JSON

and add language specific settings.

Refs: Creating User and Workspace Settings Language specific editor settings

settings.json (sample)

{
    "[json]": {
        // JSON specific settings goes here
        // "editor.tabSize": 4
    }
}

For further customization, use extensions found in market place.



Answered By - Toris
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing