-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support independent user-data-dir for extension debugging #130504
Comments
@weinand there is something here I do not really understand: the intent is to have a fully separate
If that is the case, the Maybe I miss something but what we can not do is have the |
A related question: I think we implement some of the extension host debugging features through IPC communication from the target window to the main process. I do not fully understand how that would work if the instance that is being debugged is fully separate, because then we do not share any IPC handle I think. |
@bpasero yes, before the arrival of the web UI there was a piece of code in debug land that launched a VS Code instance (the debuggee) via the command line with:
But because that would not work in the web UI, we are now using an internal API ( Before going more into the details of this API, let's delve into your statement from above:
Assuming we would still launch the debuggee from within VS Code via the command line and now we would add a
I would expect that another With my prototype the new VS Code window (blue selected line) is still just another window under the same And the new window gets indeed different settings (but probably that only works because I'm lucky :-) With these findings I see two ways how to proceed:
I think the latter approach is cleaner and most likely easier to implement. @bpasero I would like to explore this a bit more: Today the entry point is I'm not sure why the Debugging should transparently work because for js-debug extension debugging is just a form of remote debugging based on "attach". So it does not matter in which process hierarchy the debuggee lives. The only problem will be the IPC mechanism... |
Yeah I agree with the sentiment that a true separate For example, for the longest time we do some tricks such as: If you press vscode/src/vs/platform/native/electron-main/nativeHostMainService.ts Lines 730 to 735 in ee1655a
We do not offer any internal way of launching another instance of VSCode, so that call actually ends up here:
And it will open another window, independent from the config you pass in. I think if we go down this route, I would expect that the debugger implements some code on the Does that sounds reasonable? |
TL;DR with and without: Same here - osx, vscode version: Expected that it would be straight forward via Hope that this will be addressed soon, |
Any update on this issue?
|
Fixing the problem that the command line options However, the reason for using the command line options in the first place, is the problem that extension debugging always uses the "main VS Code settings and extensions". So, it is not possible to debug an extension in a clean environment. But with the recent work on settings profiles, "debugging an extension in a clean environment" is now in reach. I will close this issue in favor of the new feature request #159572: "Support extension debugging in a clean environment" |
I'm trying to decouple the "user-data-dir" used for extension debugging from the "usr-data-dir" of the "outer" VS Code instance. The goal is to allow the existing
--user-data-dir
command line flag in a launch config like this:This does not work out of the box (see #126737).
After debugging this flow through the various processes, I ended up in
WindowsMainService.openInBrowserWindow
:Here the command line argument correctly arrives in the
configuration
asuser-data-dir
, but then another propertyuserDataDir
is added based on theenvironmentMainService.userDataPath
. See the two arrows in the debug hover.After hacking/patching
vscode/src/vs/platform/windows/electron-main/windowsMainService.ts
Line 1240 in da7d76d
the new VS Code instance got its own independent user data directory (the default dark theme is the proof):
Something like this seems to solve my problem...
What do you think?
The text was updated successfully, but these errors were encountered: