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

fix: debug configuration provider replaces different provider #13196

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ export class PluginDebugService implements DebugService {
}, 100);

registerDebugConfigurationProvider(provider: PluginDebugConfigurationProvider): Disposable {
if (this.configurationProviders.has(provider.handle)) {
const configuration = this.configurationProviders.get(provider.handle);
if (configuration && configuration.type !== provider.type) {
console.warn(`Different debug configuration provider with type '${configuration.type}' already registered.`);
provider.handle = this.configurationProviders.size;
}
}
Comment on lines +100 to +106
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different way of solving it is the approach from registerDebugAdapterContribution. Instead of assigning a new handle number we can return Disposable.NULL

const handle = provider.handle;
this.configurationProviders.set(handle, provider);
this.fireOnDidConfigurationProvidersChanged();
Expand Down
Loading