Problem statement
Too much code in Visual Studio runs expensive, async work that slows down IDE shutdown.
Proposed solution
A new analyzer that ensures all JoinableTaskFactory.SwitchToMainThreadAsync calls pass in a CancellationToken (or None or default), with a fix offered to pass in VsShellUtilities.ShutdownToken. The analyzer should only activate when the VsShellUtilities.ShutdownToken symbol is available to the compilation.
Problem statement
Too much code in Visual Studio runs expensive, async work that slows down IDE shutdown.
Proposed solution
A new analyzer that ensures all
JoinableTaskFactory.SwitchToMainThreadAsynccalls pass in aCancellationToken(orNoneordefault), with a fix offered to pass inVsShellUtilities.ShutdownToken. The analyzer should only activate when theVsShellUtilities.ShutdownTokensymbol is available to the compilation.