microsoft / vscode-mock-debug

Starter sample for developing debug adapters for VSCode.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use of browser entry point?

thegecko opened this issue · comments

Could I ask what the intent of the Browser entry point is and how it's handled by VS Code?

I'm keen to see if there is a way to have a debug adapter run in the UI host and this seems to suggest this is possible.
However, my experiments show that browser entry points are ignored and main is always used.
Does it tie in somehow with the VSCE --web flag or UI Extensions?

@thegecko the Mock Debug extension can be installed and used in the browser based version of VS Code.

Excellent, where does the extension run? In the browser or on the server?

It depends on the context: if there is at least one node.js extension host, then Mock Debug will use it and if there are more than one it will use the extension host that serves the workspace (and not the UI extension host).
If there is no node.js extension host, Mock Debug will run in the browser's webworker based extension host.

This behavior can be controlled by a command line flag. See Mock Debug's launch configuration for running it in the web.

This behavior can be controlled by a command line flag. See Mock Debug's launch configuration for running it in the web.

👍

Thanks @weinand

Is there a way to specify (in the debug adapter) that it should always run in the webworker and not in the node process?
e.g. does packaging a debug adapter as a web extension force it into the webworker?

From a VSCode on the web point of view, controlling where the adapter runs can impact performance, especially if the thing being debugged is "closer" to the user's browser.

@thegecko you can control via the package.json how the DA is run. If you only have a "browser" entry point and no "main", the extension can only run in a web worker.
But I'm not aware of any "real" debugger that you could run from a web worker.