- 
                Notifications
    You must be signed in to change notification settings 
- Fork 154
Description
Is your feature request related to a problem? Please describe.
The VSTHRD103 analyzer flags calls to synchronous methods where asynchronous equivalents exist, when in an async context, as described here.
This leads to undesirable outcomes at times, when certain APIs have async versions but those async versions are significantly slower, less efficient, or simply a bad idea. But we don't want to hard-code these APIs in this analyzer.
Describe the solution you'd like
We'll use the VSTHRD010 analyzer for inspiration. VSTHRD010 reads from roslyn AdditionalFiles for APIs that are considered to assert the main thread, require the main thread, or switch to the main thread.
VSTHRD103 should read for a new filename in AdditionalFiles and parse API names using the same parser. Any API listed there will not generate a VSTHRD103 diagnostic.
For example, if the file under AdditionalFiles says that SqlDataReader.Read is OK, then calling that API is ok even though a ReadAsync method exists and you're calling Read from an async method.
Success metrics:
- Reuse the parser for the existing AdditionalFiles that VSTHRD010 reads in the VSTHRD103 analyzer.
- Add new tests for the VSTHRD103 analyzer that test that when the new file is provided in AdditionalFiles that a diagnostic is not emitted where it otherwise would be.