-
Notifications
You must be signed in to change notification settings - Fork 4k
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 the KeybindingResetDetector #60494
Fix the KeybindingResetDetector #60494
Conversation
We switched VisualStudioInfoBar to no longer be a MEF service in 347cd02, but this was still importing it. It's now a helper type, so create it instead.
How did that not break everything? e.g. i would have expected some sort of exceptions happening that should have caused problems. Do we have an exception hole somewhere? |
@@ -91,13 +92,13 @@ internal sealed class KeybindingResetDetector : ForegroundThreadAffinitizedObjec | |||
public KeybindingResetDetector( | |||
IThreadingContext threadingContext, | |||
IGlobalOptionService globalOptions, | |||
VisualStudioInfoBar infoBarService, |
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.
i don't get it. shouldn't this have broken mef? how was this type getting instantiated? and how did this not break anything else importing KeybindingResetDetector?
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 type is only instantiated here:
roslyn/src/VisualStudio/Core/Def/RoslynPackage.cs
Lines 260 to 261 in 91bd6e5
// Initialize keybinding reset detector | |
await ComponentModel.DefaultExportProvider.GetExportedValue<KeybindingReset.KeybindingResetDetector>().InitializeAsync().ConfigureAwait(true); |
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 line is hiding it:
LoadComponentsBackgroundAsync(cancellationToken).Forget(); |
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.
Something doesn't make sense to me here.
@CyrusNajmabadi: It throws exceptions here: roslyn/src/VisualStudio/Core/Def/RoslynPackage.cs Lines 260 to 261 in 91bd6e5
Which is a fire-and-forget path. |
bleaghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh. |
@CyrusNajmabadi Updated to report non-fatal telemetry if that throws. |
Some testing makes us think this feature is more generally broken; until we understand why we'll merge this for 17.3 to avoid the MEF composition issue, and we'll need to investigate further. |
We switched VisualStudioInfoBar to no longer be a MEF service in 347cd02, but this was still importing it. It's now a helper type, so create it instead.