Table of Contents

Class ValueTaskMisuseCodeFixProvider

Namespace
CryptoHives.Foundation.Threading.Analyzers
Assembly
CryptoHives.Foundation.Threading.Analyzers.dll

Provides code fixes for ValueTask misuse patterns detected by ValueTaskMisuseAnalyzer.

[ExportCodeFixProvider("C#", new string[] { }, Name = "ValueTaskMisuseCodeFixProvider")]
[Shared]
public sealed class ValueTaskMisuseCodeFixProvider : CodeFixProvider
Inheritance
ValueTaskMisuseCodeFixProvider
Inherited Members

Properties

FixableDiagnosticIds

A list of diagnostic IDs that this provider can provide fixes for.

public override ImmutableArray<string> FixableDiagnosticIds { get; }

Property Value

ImmutableArray<string>

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

FixAllProvider

RegisterCodeFixesAsync(CodeFixContext)

Computes one or more fixes for the specified CodeFixContext.

public override Task RegisterCodeFixesAsync(CodeFixContext context)

Parameters

context CodeFixContext

A 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.

Returns

Task