As I said in the comments, I cannot really cover the entire topic, and we agree to shorten it. And even in this case... I'm not sure what part you already know, so I have to start with first principles. This Extension Host technology is relatively complicated, but it makes VSCode extension development pretty convenient. The key is to run two different VSCode instances. I'll call them Instance A and Instance B.
Instance A
Let's say you have already functional extension code. You can debug it using a specially set up launch.json, something like this:
{
"version": "0.2.0",
"configurations": [
{
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"name": "Launch Extension",
"request": "launch",
"type": "extensionHost"
},
]
}
Now when you hit F5, another VSCode instance is started, let's call it Instance B.
Instance B — Extension Host
This instance is called Extension Host. Is it unusual in the following way: your extension under the development is loaded on a temporary basis and only for this VSCode instance. If your extension is already installed, the installed code will be ignored, the effective extension version is the one you are debugging. You will see the string [Extension Development Host]... in your search line.
Generally, this instance does not have to do anything related to programming. Its workspace has to use some features addressed by the extension, so you could test the behavior.
Restart Command
Developer: Restart Extension Host
You can invoke this command in Instance B, in contrast to restarting the debugging session you can restart in Instance A with Ctrl+Shift+F5.
This command is a more lightweight action, it is faster, does not break the debugger attachment, and it can preserve some of the Instance B states, and so on. Roughly speaking, it internally skips some relatively long initialization of the debugging session. You could have noticed that this initialization can take some time, depending on the product you debug.
Two Debug Commands: Developer: Debug Extension Host in...
These two commands are more advanced and not even related to F5 launch of your extension code:
Developer: Debug Extension Host In Dev Tools
Developer: Debug Extension Host In New Window
Generally, these two tools are way more advanced and not used often. They can be useful when your extension is already developed, published, and installed globally in your system. By running an Extension Host using these tools, you just analyze its behavior to find the sources of bugs, glitches, and the like.
In Dev Tools...
The command starts Electron Dev Tools (VSCode is implemented as an Electron application), which is functionally the same thing as the Chromium Dev Tools. The window similar to the Chromium Dev Tools window is opened in a VSCode instance.
This is too big topic. You can inspect objects, track the network activity, and a lot more.
In New Window...
This is a new dedicated window that looks exactly like any other VSCode window. It serves as a pure debugging interface via the RUN AND DEBUG section of the Explorer. You will see the call stack, watches, breakpoins and so on, immediately after starting the debugging session. It is used for in-depth debugging of an existing extension.
References
VSCode API used in extension development
VSCode Extension API
General information on using Extension Host and its configuration:
https://code.visualstudio.com/api/advanced-topics/extension-host
These references are incomplete. Unfortunately, the extension development information is not concentrated but is disperced in different sources...