CodeFixProvider Class

Definition

Implement this type to provide fixes for source code problems. Remember to use ExportCodeFixProviderAttribute so the host environment can offer your fixes in a UI.

public ref class CodeFixProvider abstract
public abstract class CodeFixProvider
type CodeFixProvider = class
Public MustInherit Class CodeFixProvider
Inheritance
CodeFixProvider

Constructors

CodeFixProvider()

Properties

FixableDiagnosticIds

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

RequestPriority

Priority class this refactoring provider should run at. Returns Default if not overridden. Slower, or less relevant, providers should override this and return a lower value to not interfere with computation of normal priority providers.

Methods

ComputeRequestPriority()

Computes the CodeActionRequestPriority group this provider should be considered to run at. Legal values this can be must be between Low and High.

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.

RegisterCodeFixesAsync(CodeFixContext)

Computes one or more fixes for the specified CodeFixContext.

Applies to