FixAllProvider Class

Definition

Implement this abstract type to provide fix all/multiple occurrences code fixes for source code problems. Alternatively, you can use any of the well known fix all providers from WellKnownFixAllProviders.

C#
public abstract class FixAllProvider
Inheritance
FixAllProvider
Derived

Constructors

Methods

Create(Func<FixAllContext,Document,ImmutableArray<Diagnostic>,Task<Document>>, ImmutableArray<FixAllScope>)

Create a FixAllProvider that fixes documents independently for the given supportedFixAllScopes. This should be used instead of BatchFixer in the case where fixes for a Diagnostic only affect the Document the diagnostic was produced in.

Create(Func<FixAllContext,Document,ImmutableArray<Diagnostic>,Task<Document>>)

Create a FixAllProvider that fixes documents independently. This should be used instead of BatchFixer in the case where fixes for a Diagnostic only affect the Document the diagnostic was produced in.

GetFixAsync(FixAllContext)

Gets fix all occurrences fix for the given fixAllContext.

GetSupportedFixAllDiagnosticIds(CodeFixProvider)

Gets the diagnostic IDs for which fix all occurrences is supported. By default, it returns FixableDiagnosticIds for the given originalCodeFixProvider.

GetSupportedFixAllScopes()

Gets the supported scopes for fixing all occurrences of a diagnostic. By default, it returns the following scopes: (a) Document (b) Project and (c) Solution

Applies to

Ürün Sürümler
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0