-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Run DebugConfigurationProviders for the result type of another DebugConfigurationProvider #143054
Run DebugConfigurationProviders for the result type of another DebugConfigurationProvider #143054
Conversation
…onfigurationProvider This enables chaining `DebugConfigurationProvider`s with two or more `type` changes (one `type` change is already supported) and calling `DebugConfigurationProvider`'s `resolveConfigurationsByProviders` callback when providers are chained. Fixes microsoft#142135 I'm not sure where to add tests, so I would appreciate any pointers.
I've added some tests for this code. @weinand anything else you'd like me to do for this PR? |
@@ -119,22 +118,34 @@ export class ConfigurationManager implements IConfigurationManager { | |||
} | |||
|
|||
async resolveConfigurationByProviders(folderUri: uri | undefined, type: string | undefined, config: IConfig, token: CancellationToken): Promise<IConfig | null | undefined> { | |||
// activate debuggers early for the provided type in case any '*' typed debug configuration providers are activated | |||
// based on the provided type. | |||
await this.adapterManager.activateDebuggers('onDebugResolve', type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unnecessary since the first resolveDebugConfigurationForType
will activate the type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just so you do the filter once below instead of inside resolveDebugConfigurationForType
? I would probably keep it as it was before. Most debug calls won't hit this more than once, and even for the ones that do an await
costs much more than filter
ing the relatively small list of configProvider
cc @roblourens. This looks generally okay to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but I agree with the comment about calling activate twice
This enables chaining
DebugConfigurationProvider
s with two or moretype
changes (onetype
change is already supported) and callingDebugConfigurationProvider
'sresolveConfigurationsByProviders
callback when providers are chained.This can be tested manually be defining two different configuration providers and having one return a configuration with the 'type' of the next one and ensuring that the second callback is called.
This PR fixes #142135
Fixes #110889