Share via


CodeAction.EquivalenceKey Property

Definition

Two code actions are treated as equivalent if they have equal non-null EquivalenceKey values and were generated by the same CodeFixProvider or CodeRefactoringProvider.

public:
 virtual property System::String ^ EquivalenceKey { System::String ^ get(); };
public virtual string EquivalenceKey { get; }
public virtual string? EquivalenceKey { get; }
member this.EquivalenceKey : string
Public Overridable ReadOnly Property EquivalenceKey As String

Property Value

Remarks

Equivalence of code actions affects some Visual Studio behavior. For example, if multiple equivalent code actions result from code fixes or refactorings for a single Visual Studio light bulb instance, the light bulb UI will present only one code action from each set of equivalent code actions. Additionally, a Fix All operation will apply only code actions that are equivalent to the original code action.

If two code actions that could be treated as equivalent do not have equal EquivalenceKey values, Visual Studio behavior may be less helpful than would be optimal. If two code actions that should be treated as distinct have equal EquivalenceKey values, Visual Studio behavior may appear incorrect.

Applies to