Open sandboxFocus

Class CodeFixFactory

Creates instances of the CodeFix class.

Inheritance
CodeFixFactory
Namespace: Metalama.Framework.CodeFixes
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public static class CodeFixFactory

Methods

Name Description
AddAttribute(IDeclaration, INamedType, string?)

Creates a CodeFix that adds a custom attribute to a declaration, without constructor or named arguments, by specifying the INamedType of the attribute.

AddAttribute(IDeclaration, Func<AttributeConstruction>, string)

Creates a CodeFix that adds a custom attribute to a declaration, with constructor or named arguments, by providing an AttributeConstruction.

AddAttribute(IDeclaration, Type, string?)

Creates a CodeFix that adds a custom attribute to a declaration, without constructor or named arguments, by specifying the reflection Type of the attribute.

ApplyAspect<T>(T, IAspect<T>, string?)

Creates a CodeFix that applies a given aspect to a given declaration, so that the source code itself is modified by the aspect.

ChangeAccessibility(IMemberOrNamedType, Accessibility, string?)

Creates a CodeFix that changes the accessibility of a given type or member.

RemoveAttributes(IDeclaration, INamedType, string?)

Creates a CodeFix that removes all custom attributes of a given type from a declaration and all container declarations, by specifying the INamedType of the attribute.

RemoveAttributes(IDeclaration, Type, string?)

Creates a CodeFix that removes all custom attributes of a given type from a declaration and all container declarations, by specifying the reflection Type of the attribute.