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

DebugConfigurationProvider should support compound targets #115719

Closed
karljs opened this issue Feb 3, 2021 · 9 comments
Closed

DebugConfigurationProvider should support compound targets #115719

karljs opened this issue Feb 3, 2021 · 9 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality

Comments

@karljs
Copy link

karljs commented Feb 3, 2021

Because compound targets are not debug "configurations", but rather included separately under the "compounds" key in launch.json, it is not possible for a debugging extension to provide a compound configuration. It should be possible, in some way, to dynamically provide a compound target.

There is an overlapping request from 3.5 years ago which was marked "out of scope" with no explanation:
#37193

I am hoping that this can be re-evaluated now.

@vscodebot
Copy link

vscodebot bot commented Feb 3, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@isidorn isidorn added the debug Debug viewlet, configurations, breakpoints, adapter issues label Feb 4, 2021
@alexweininger
Copy link
Member

A way to dynamically resolve compound configurations based on the current debug configurations would be much appreciated. I would love to see resolveCompoundConfiguration and provideCompoundConfigurations.

@weinand weinand added the feature-request Request for new features or functionality label Sep 9, 2021
@weinand
Copy link
Contributor

weinand commented Oct 21, 2021

For DebugConfigurationProvider.provideCompoundConfiguration we could just extend the return type to allow for compound configurations, e.g. something like (DebugConfiguration | DebugCompoundConfiguration)[]. I think that would be non-breaking.

Doing the same for DebugConfigurationProvider.resolveDebugConfiguration is not possible because multiple DebugConfigurationProvider registered for the same debug type result in chained resolveDebugConfiguration calls so that the returned result from one is passed as an argument into the next.
Consequently we would have to change the signature of resolveDebugConfiguration in two locations:

resolveDebugConfiguration?(..., debugConfiguration: DebugConfiguration | DebugCompoundConfiguration, ...): 
       ProviderResult<DebugConfiguration | DebugCompoundConfiguration>;

but this would be a breaking change.

Introducing a new resolveDebugConfigurations method (note the plural 's') would result in some ugly and complex semantics: when is it called and how does it interact with resolveDebugConfiguration (singular) if both are implemented. I really don't like this.

But maybe there is a workaround: if it is really necessary to start more than one debug session from resolveDebugConfigurations, the additional sessions could be started with the debug.startDebugging API.

@alexweininger
Copy link
Member

For DebugConfigurationProvider.provideCompoundConfiguration we could just extend the return type to allow for compound configurations, e.g. something like (DebugConfiguration | DebugCompoundConfiguration)[]. I think that would be non-breaking.

This solution sounds like it would work perfectly.

But maybe there is a workaround: if it is really necessary to start more than one debug session from resolveDebugConfigurations, the additional sessions could be started with the debug.startDebugging API.

I will try out this workaround soon and report back.

Thanks!

cc: @nturinski

@alexweininger
Copy link
Member

But maybe there is a workaround: if it is really necessary to start more than one debug session from resolveDebugConfigurations, the additional sessions could be started with the debug.startDebugging API.

So far in my prototyping the suggested workaround has worked well. I think we will go forward using this solution.

cc: @isidorn

@isidorn
Copy link
Contributor

isidorn commented Oct 23, 2021

@alexweininger this is great to now. And I agree going forward with that approach sounds good.

Maybe it would be useful that we schedule a 30min sync meeting where we would just talk about debugging.
We would be interested in how Azure extensions are using the debug infrastructure.
Let me know what you think and keep in mind that next week I am on vacation so I might be slow to respond.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 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 feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants
@karljs @weinand @isidorn @alexweininger and others