DocumentBasedFixAllProvider Class

Definition

Provides a base class to write a FixAllProvider that fixes documents independently. This type should be used instead of BatchFixer in the case where fixes for a Diagnostic only affect the Document the diagnostic was produced in.

public abstract class DocumentBasedFixAllProvider : Microsoft.CodeAnalysis.CodeFixes.FixAllProvider
type DocumentBasedFixAllProvider = class
    inherit FixAllProvider
Public MustInherit Class DocumentBasedFixAllProvider
Inherits FixAllProvider
Inheritance
DocumentBasedFixAllProvider

Remarks

This type provides suitable logic for fixing large solutions in an efficient manner. Projects are serially processed, with all the documents in the project being processed in parallel. Diagnostics are computed for the project and then appropriately bucketed by document. These are then passed to FixAllAsync(FixAllContext, Document, ImmutableArray<Diagnostic>) for implementors to process.

Constructors

DocumentBasedFixAllProvider()
DocumentBasedFixAllProvider(ImmutableArray<FixAllScope>)

Methods

FixAllAsync(FixAllContext, Document, ImmutableArray<Diagnostic>)

Fix all the diagnostics present in document. The document returned will only be examined for its content (e.g. it's SyntaxTree or SourceText. No other aspects of (like it's properties), or changes to the Project or Solution it points at will be considered.

GetFixAllTitle(FixAllContext)

Produce a suitable title for the fix-all CodeAction this type creates in GetFixAsync(FixAllContext). Override this if customizing that title is desired.

GetFixAsync(FixAllContext)
GetSupportedFixAllDiagnosticIds(CodeFixProvider)

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

(Inherited from FixAllProvider)
GetSupportedFixAllScopes()

Applies to