Open sandboxFocus

Interface ICodeActionBuilder

Argument of the delegate passed to CodeFix constructor. Exposes methods that allow to modify the current solution.

Namespace: Metalama.Framework.CodeFixes
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public interface ICodeActionBuilder

Properties

Name Description
Context

Gets the context of the current code action. Exposes the CancellationToken and the IServiceProvider.

Methods

Name Description
AddAttributeAsync(IDeclaration, AttributeConstruction)

Adds a custom attribute to a given declaration.

ApplyAspectAsync<TTarget>(TTarget, IAspect<TTarget>)

Applies an aspect to a given declaration (so that the source code of the given declaration is modified by the affect).

ChangeAccessibilityAsync(IMemberOrNamedType, Accessibility)

Changes the visibility of a type or member.

RemoveAttributesAsync(IDeclaration, INamedType)

Removes custom attributes of a type, given as an INamedType, from a given declaration and all contained declarations.

RemoveAttributesAsync(IDeclaration, Type)

Removes custom attributes of a type, given as a reflection Type, from a given declaration and all contained declarations.