On Windows: Shift + Alt + F
On Mac: Shift + Option + F
On Linux: Ctrl + Shift + I
Original answer How do you format code in Visual Studio Code (VSCode)?
I'm adding it here because when I was looking for it I found your post before the other one. Hope it helps.
Answer from manuelbcd on Stack OverflowVideos
On Windows: Shift + Alt + F
On Mac: Shift + Option + F
On Linux: Ctrl + Shift + I
Original answer How do you format code in Visual Studio Code (VSCode)?
I'm adding it here because when I was looking for it I found your post before the other one. Hope it helps.
Be aware that if you have the setting
JSON > format: Keep Lines
enabled (the default is disabled), that a one-liner JSON file (or any JSON that has multiple key/values on the same line) will not be formatted as you wish. The file might not change at all until you disable the Keep Lines setting and re-format.
There are a couple I've tried, but they either aren't what I need or aren't updated anymore... JSON Editors I've tried:
JSON Editor (and a lot of forks of this repo)
JSON Tree Editor
JSON
What's your favorite JSON editor?
Hello to everybody!
this is my first post on reddit and I am new to Typescript and VSCode extension development.So please be kind and don't throw with stones...even when this post looks foolish!Thanks in advance!
I would like to build a VSCode extension that should help me doing my all-day work a little bit more efficient and faster.One part of this extension is a custom view in the activitybar that should be populated by a JSON file.This JSON file should be integrated somewhere in the extensions' source code.That means, the extension should read it in the background and build a treeview with only 2 levels.This file could be changed very rarely from time to time...and when, only by me as the extensions' author. So it's more or less a static content source.
The JSON file itself looks like this and is named for example "view-source.json":
{
"portal": {
"flush": "portal.flush(param1, param2)",
"get_stats": "portal.get_stats(param1, param2)",
"setup": "portal.setup(param1, param2)",
"version": "portal.version(param1, param2)"
},
"xml": {
"transform": "transform(param1, param2)",
"update": "update(param1, param2)",
"xml_to_json": "xml_to_json(param1, param2)"
}
}What I want to achieve is the following view:
The treeviewAs you can see, the JSON object provided 2 properties that should build the first level in the treeview.The second level should be created on basis of the objects properties that are hold by the first-level props.At this moment, I only want to get the view without any additional functionalities...only the view that is populated from the JSON file every time VSCode starts.
What you also can see so far is, that I understand how to provide the activitybar icon and view and how to use the package.json to add views to it. The next step is now to fill the view(s) with items.
Before someone tends to answer something like "RTFM"...I have studied the official VSCode manuals and API docs. I tried a lot of the VSCode examples on Github provided by Microsoft and the community. And I had also a look at some officially released marketplace extension.I really want to get it and all these examples are great...But for me personally, the docs and the samples are either too simple or too complex.I need something in between...something more intermediate.
At the moment I am building my skills from the scratch and for that I need some help.
If possible, it would be very very awesome when someone could provide me the most simple example suitable for the thing I described above. This would kick-start me a lot!
Thanks in advance for reading this post and (maybe) for some examples and/or advices!