-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: debug configuration provider replaces different provider #13196
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
Conversation
Signed-off-by: arekzaluski <[email protected]>
| 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; | ||
| } | ||
| } |
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.
Different way of solving it is the approach from registerDebugAdapterContribution. Instead of assigning a new handle number we can return Disposable.NULL
planger
left a comment
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.
Thanks, looks good to me! 👍
|
@thegecko If you merge now, it is the todays release :-) |
…e-theia#13196) Signed-off-by: arekzaluski <[email protected]>
When frontend and main VS Code extensions load together, Theia creates two extension host instances to manage different kinds of extensions. Each will register the extensions' contributed debug adapter configuration providers with incremented handles. In cases of handle collisions during the registration of debug configurations, Theia adjusts the handle of incoming providers. However, this adjustment causes issues as the extension host no longer associates the new handle with the original ID. For instance, if the main VSIX contributes two debuggers assigned handles `0` and `1`, and the web VSIX contributes a debugger with a colliding handle `0`, Theia changes the web provider's handle to `2`. Subsequently, when starting a debug session, the main extension attempts to resolve handle `2`, but the frontend extension host only recognizes the initial configuration. This commit addresses the issue by storing the original handle of the debug adapter configuration. During handle ID lookups, it will reference the originally assigned handle instead of the adjusted one, ensuring proper resolution and functionality across both extension host instances. Ref: eclipse-theia#13196
When frontend and main VS Code extensions load together, Theia creates two extension host instances to manage different kinds of extensions. Each will register the extensions' contributed debug adapter configuration providers with incremented handles. In cases of handle collisions during the registration of debug configurations, Theia adjusts the handle of incoming providers. However, this adjustment causes issues as the extension host no longer associates the new handle with the original ID. For instance, if the main VSIX contributes two debuggers assigned handles `0` and `1`, and the web VSIX contributes a debugger with a colliding handle `0`, Theia changes the web provider's handle to `2`. Subsequently, when starting a debug session, the main extension attempts to resolve handle `2`, but the frontend extension host only recognizes the initial configuration. This commit addresses the issue by storing the original handle of the debug adapter configuration. During handle ID lookups, it will reference the originally assigned handle instead of the adjusted one, ensuring proper resolution and functionality across both extension host instances. Ref: #13196
When frontend and main VS Code extensions load together, Theia creates two extension host instances to manage different kinds of extensions. Each will register the extensions' contributed debug adapter configuration providers with incremented handles. In cases of handle collisions during the registration of debug configurations, Theia adjusts the handle of incoming providers. However, this adjustment causes issues as the extension host no longer associates the new handle with the original ID. For instance, if the main VSIX contributes two debuggers assigned handles `0` and `1`, and the web VSIX contributes a debugger with a colliding handle `0`, Theia changes the web provider's handle to `2`. Subsequently, when starting a debug session, the main extension attempts to resolve handle `2`, but the frontend extension host only recognizes the initial configuration. This commit addresses the issue by storing the original handle of the debug adapter configuration. During handle ID lookups, it will reference the originally assigned handle instead of the adjusted one, ensuring proper resolution and functionality across both extension host instances. Ref: eclipse-theia#13196
What it does
This PR solves the problem when multiple plugins try to register debug configuration provider under the same handle number. Currently the old provider gets replaced. After this change the new number will be assigned.
Similar guard exists already in
registerDebugAdapterContributionHow to test
Follow-ups
Review checklist
Reminder for reviewers