-
Notifications
You must be signed in to change notification settings - Fork 58
Attach to extension host #4
Comments
@roblourens This is basically a launch followed by an attach. But the launch uses VS Code to launch an extension host via some special command line arguments. And the disconnectRequest needs special code to support reloading the extension host. Please note, that for testing this VS Code needs to be modified so that it uses a version of node that supports CDP (instead of the node version that Electron uses). For that reason I do not think that this feature needs to be implemented before node v7 has arrived in Electron. |
Oh, good point. I'll move it to lowest priority |
Blocked? electron/electron#6634 |
Blocked on microsoft/vscode#28582 |
@roblourens I'll provide detailed info for what needs to be done here. |
@roblourens here are some steps for what needs to be done to support "inspector" protocol based EH debugging:
|
Thanks! Will start on this today. |
I implemented this but there are two issues: when the attach request comes in, the debug config has type 'extensionHost' instead of 'extensionHost2'. But that's not a big deal. Also I can't get 'restart' to work. It looks like it's vscode's job to restart the extensionHost window? I have the fix to not kill the process for a restart, and I send a TerminatedEvent the same as vscode-node-debug, but it doesn't reload the window. Debugged the vscode side but I'm not sure what's missing. cc @isidorn |
@isidorn could you send the "attach" request with the massaged config that you receive in the 'vscode.startDebug' command? @roblourens Isi has fixed "restart" in today's Insiders by basically doing a reload window on the extension host window. Did you try with that version? Without the fix I was not seeing any effect with node-debug when pressing the restart button. That was bug microsoft/vscode#31445. |
Thanks for the tip, I'm building out of the electron/1.7.4 branch so I'll try with newer stuff merged in. |
Yes, if the electron branch hasn't been updated, it misses several fixes for EH debugging problems (that got introduced because of the multi-folder work). I noticed that when trying to use the Electron 1.7.4 build two days ago. |
@isidorn in EH debugging, the launchRequest starts the extension host (via VS Code) but the DA does not connect (aka "attach") to it (in normal "node" debugging the DA connects to the launched debuggee automatically). Instead VS Code knows when the EH is ready and then broadcasts an event that you will pick up and issue the missing "attach" request for it. This is basically the same sequence as the "reload EH window" sequence. For the "attach" request that you issue in response to the broadcast, you use the initial "launch" configuration and just change the "request" attribute from "launch" to "attach". The fix is to remember the massaged launch config (that got the type "extensionHost2"), and create the "attach" config based on this. |
@weinand thanks for the explanation, do we need this for july? If not, I will create a new issue for me |
@isidorn No, not for July (and as Rob said: this is not a big deal). We should fix this more for consistency: if a launch config is modified in the extension, we should always use the modified config and not fall back to the original config. |
@weinand makes sense, created microsoft/vscode#31659 |
Not sure how this is different from attaching to a typical node process
The text was updated successfully, but these errors were encountered: