Class SemaphoreSlimAsAsyncLockCodeFixProvider
- Namespace
- CryptoHives.Foundation.Threading.Analyzers
- Assembly
- CryptoHives.Foundation.Threading.Analyzers.dll
Provides a code fix for SemaphoreSlimAsAsyncLock (CHT009)
that replaces new SemaphoreSlim(1, 1) with new AsyncLock() and adds the
required using directive.
[ExportCodeFixProvider("C#", new string[] { }, Name = "SemaphoreSlimAsAsyncLockCodeFixProvider")]
[Shared]
public sealed class SemaphoreSlimAsAsyncLockCodeFixProvider : CodeFixProvider
- Inheritance
-
SemaphoreSlimAsAsyncLockCodeFixProvider
- Inherited Members
Properties
FixableDiagnosticIds
A list of diagnostic IDs that this provider can provide fixes for.
public override ImmutableArray<string> FixableDiagnosticIds { get; }
Property Value
Methods
GetFixAllProvider()
Gets an optional FixAllProvider that can fix all/multiple occurrences of diagnostics fixed by this code fix provider. Return null if the provider doesn't support fix all/multiple occurrences. Otherwise, you can return any of the well known fix all providers from WellKnownFixAllProviders or implement your own fix all provider.
public override FixAllProvider GetFixAllProvider()
Returns
RegisterCodeFixesAsync(CodeFixContext)
Computes one or more fixes for the specified CodeFixContext.
public override Task RegisterCodeFixesAsync(CodeFixContext context)
Parameters
contextCodeFixContextA CodeFixContext containing context information about the diagnostics to fix. The context must only contain diagnostics with a Id included in the FixableDiagnosticIds for the current provider.