Bug description
- Version of the vssdk-analyzers: 17.11.13-preview
- Analyzer rule: VSTHRD010
- Error (exception message, type, and callstack where applicable):
To Reproduce
- CTRL+. on the point marked by $
private JoinableTaskContext joinableTaskContext;
public int Invoke(IVsInvokablePrivate pInvokable)
{
try
{
return this.joinableTaskContext.Factory.Run(async delegate
{
await this.joinableTaskContext.Factory.SwitchToMainThreadAsync();
return pInvokable.$Invoke(); // <--- here
});
}
catch (Exception ex)
{
return Marshal.GetHRForException(ex);
}
}
See: https://github.com/microsoft/vssdktestfx/blob/main/src/Microsoft.VisualStudio.Sdk.TestFramework/GlobalServiceProvider.cs#L299-L313
Expected behavior
No crash
Actual behavior
Crash:
System.ArgumentException : A non-empty value is required.
Parameter name: methodAsString
at Microsoft.VisualStudio.Threading.Analyzers.Utils.FindMethodGroup(SemanticModel semanticModel,String methodAsString)
at async Microsoft.VisualStudio.Threading.Analyzers.VSTHRD010MainThreadUsageCodeFix.RegisterCodeFixesAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeFixes.CodeFixService.GetCodeFixesAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsyncT
Bug description
To Reproduce
See: https://github.com/microsoft/vssdktestfx/blob/main/src/Microsoft.VisualStudio.Sdk.TestFramework/GlobalServiceProvider.cs#L299-L313
Expected behavior
No crash
Actual behavior
Crash:
System.ArgumentException : A non-empty value is required.
Parameter name: methodAsString
at Microsoft.VisualStudio.Threading.Analyzers.Utils.FindMethodGroup(SemanticModel semanticModel,String methodAsString)
at async Microsoft.VisualStudio.Threading.Analyzers.VSTHRD010MainThreadUsageCodeFix.RegisterCodeFixesAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeFixes.CodeFixService.GetCodeFixesAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsyncT