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

Add a way to initializate debug extension before every new debug session #81806

Closed
TylerLeonhardt opened this issue Oct 1, 2019 · 12 comments
Closed
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality info-needed Issue requires more information from poster
Milestone

Comments

@TylerLeonhardt
Copy link
Member

Version: 1.39.0-insider
Commit: b0d714d
Date: 2019-09-26T09:05:41.420Z
Electron: 6.0.9
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 18.7.0

Steps to Reproduce:

  1. open a powershell file with the PowerShell e x tension
  2. drop a breakpoint and F5
  3. Hit the restart button when the breakpoint is hit

You'll notice nothing happens... this is because resolveDebugConfiguration is not run for when the debug adapter is starting up again so it can't set up needed state on the client side.

The 'restart' command isn't supported so this is behavior should be shutting down and starting up the debug adapter again.

Is this by design that it's not running resolveDebugConfiguration on restart? If so, any recs on how we can set up state in the extension host side before the debug adapter is launched?

@isidorn
Copy link
Contributor

isidorn commented Oct 3, 2019

@TylerLeonhardt yes this is by design.
VSCode will only re-read the configuration and resolve it again if the underlying launch.json file changed. Code pointer

So as a workaround your extension can just make some edit to the underlying launch.json.
However setting up state in the resolveDebugConfiguration should not be done. The resolveDebugConfiguration is only for resolving the configuration, your extension should optimally not do too much things there.
For example your extension can listen to onDidStartDebugSession. Though this might be a bit too late.
If you need to setup your state only once you can be actived onDebugType events. However we might be missing a mechanism that you intiialize before every new session. For that you can file a new feature request. Though @weinand might have some ideas which I am missing

@isidorn isidorn added debug Debug viewlet, configurations, breakpoints, adapter issues under-discussion Issue is under discussion for relevance, priority, approach labels Oct 3, 2019
@TylerLeonhardt
Copy link
Member Author

Does the onDidStartDebugSession happen after the debug server and client exchange something? If so, then that's sadly too late.

intiialize before every new session

yeah this is exactly what I'm looking for.

@TylerLeonhardt
Copy link
Member Author

We can change the title of this issue to maybe "Add a mechanism to allow for initialization before every new debug session"?

@isidorn isidorn changed the title resolveDebugConfiguration not running after restarting debugger Add a way to initializate debug extension before every new debug session Oct 7, 2019
@isidorn isidorn added feature-request Request for new features or functionality and removed under-discussion Issue is under discussion for relevance, priority, approach labels Oct 7, 2019
@isidorn isidorn added this to the Backlog milestone Oct 7, 2019
@isidorn
Copy link
Contributor

isidorn commented Oct 7, 2019

Yes, I have renamed it. And it is a fair feature request
fyi @weinand

@isidorn isidorn modified the milestones: Backlog, Backlog Candidates Oct 23, 2019
@vscodebot
Copy link

vscodebot bot commented Jan 15, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@TylerLeonhardt
Copy link
Member Author

I find it unlikely that this will gain enough traction considering it's only an ask from the extension development side.

I'd would love to see more discussion from the VS Code team side on this as it would still be nice to have available for extension authors.

@vscodebot
Copy link

vscodebot bot commented Mar 6, 2020

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding

@TylerLeonhardt
Copy link
Member Author

Pls no

@isidorn isidorn modified the milestones: Backlog Candidates, Backlog Mar 6, 2020
@isidorn isidorn assigned roblourens and unassigned isidorn Aug 17, 2021
@roblourens
Copy link
Member

Sorry I don't understand the use-case, why do you need this?

If there is some setup to run when the debug adapter starts, then wouldn't the debug adapter code itself do that?

@TylerLeonhardt
Copy link
Member Author

Basically there is code inside of resolveDebugConfiguration that was needed in order to properly spin up the Debug Adapter... but that code wasn't run on restart so the PowerShell debug session wouldn't work.

@roblourens
Copy link
Member

That should be in a DebugAdapterDescriptorFactory though, resolveDebugConfiguration seems the wrong place for it

@roblourens roblourens added the info-needed Issue requires more information from poster label Dec 14, 2022
@TylerLeonhardt
Copy link
Member Author

Yeah I tried the powershell extension today and it seems to be working so I think the scenario is covered.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2023
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 feature-request Request for new features or functionality info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants