![]() ![]() When I pasted the raw JSON in Code it looked like this.Ĭlearly this is not being identified as JSON so any attempts to format this using Shift+Alt+F are going to fail. It removes the necessity to format code manually (and reformat, and reformat again), arranging code continuously as you type and make changes. VS Code is sensitive to what language file is. I need a way to let Code know my file is JSON. CMD + Shift + P -> Format Selection Keyboard Shortcuts Visual Studio Code provides default keyboard shortcuts for code formatting. Of course I could save the file with a JSON extension and Code would start to treat the file as a JSON file. You can learn about these for each platform in the VS Code documentation. But I want it to treat it like JSON even before I save it. Well I pinged the Code team on twitter and they showed me this cool trick. In the lower right hand corner of the screen is an area to change the Language Mode. Visual Studio Code Market Place: Prettier - Code formatter. Simply click that area, then select the desired language. ![]() Can also be installed in VS Code: Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |