Skip to content
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

Extension debug: --user-data-dir must be used for debug launch #44734

Closed
bpasero opened this issue Feb 28, 2018 · 8 comments
Closed

Extension debug: --user-data-dir must be used for debug launch #44734

bpasero opened this issue Feb 28, 2018 · 8 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Feb 28, 2018

Steps to Reproduce:

  1. run VSCode with --user-data-dir <some folder>
  2. debug an extension

=> the debugger starts another instance of VS Code without the user-data-dir argument and as such debugging will not work

Possible fix is to add the same argument again.

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Feb 28, 2018
@weinand
Copy link
Contributor

weinand commented Feb 28, 2018

The user-data-dir argument is only the tip of the iceberg; there are probably more CLI arguments that would need to be passed on too.

The debugger could probably find the relevant CLI arguments passed to its own VS Code instance and pass them onto the debuggee VS Code instance.

But I would prefer an approach where the debugger would not have to understand what these arguments are.

I think there are two options for how to do this:

  • the debugger retrieves the relevant CLI arguments en-bloc via some API and passes them on to the debuggee blindly,
  • the debugger passes only an ID of the originating VS Code instance on to the debuggee so that it could retrieve the relevant CLI arguments itself.

The advantage of the first approach is that the debugger could show the real command line for the debuggee in the debug console, so the "--user-data-dir" would be visible.

/cc @isidorn @roblourens

@weinand weinand added this to the March 2018 milestone Feb 28, 2018
@roblourens
Copy link
Member

Yes I guess we would need an extension host API for this.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Mar 8, 2018

I also hit this issue after using --user-data-dir. I discovered the workaround of passing the --user-data-dir in the args. The workaround runs into problems if the launch.json is shared between VS Code instances with different --user-data-dir set, but that's not too big of an issue for me.

@sean-mcmanus
Copy link
Contributor

FYI, I accidently used a space instead of = when setting --user-data-dir and it gave some confusing error message and my extension failed to activate...not sure if there's a better way to handle that type of error.

@alefragnani
Copy link

alefragnani commented Feb 3, 2019

In the current releases (both Stable and Insiders), I'm not being able to debug an extension with --user-data-dir.

Both releases complains about timeout, but the Stable, shows the already known 10 seconds timeout message in the [Extension Host]window, and the Insiders pop ups a dialog message in the extension's source window.

Is there any current workaround for that?

Thanks in advance

@weinand weinand added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Nov 9, 2020
@weinand
Copy link
Contributor

weinand commented Oct 14, 2021

This is basically a duplicate of #130504.
Since #130504 has more recent information I'm closing this issue.

@weinand
Copy link
Contributor

weinand commented Oct 14, 2021

/duplicate #130504

@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

6 participants
@roblourens @bpasero @weinand @alefragnani @sean-mcmanus and others