Macro
Describes a macro.
protocol Macro
Browse conforming typesDescribes a macro.
protocol Macro
import SwiftSyntaxMacros
static var formatMode: FormatMode { get }
How the resulting expansion should be formatted, .auto
by default. Use .disabled
for the expansion to be used as is.
static var formatMode: FormatMode { get }
protocol AccessorMacro : AttachedMacro
Describes a macro that adds accessors to a given declaration.
protocol AttachedMacro : Macro
Describes a macro that is attached, meaning that it is used with custom attribute syntax and attached to another entity.
protocol BodyMacro : AttachedMacro
Describes a macro that can create the body for a function that does not have one.
protocol CodeItemMacro : FreestandingMacro
Describes a macro that forms code items in a function or closure body.
protocol DeclarationMacro : FreestandingMacro
Describes a macro that forms declarations.
protocol ExpressionMacro : FreestandingMacro
Describes a macro that is explicitly expanded as an expression.
protocol ExtensionMacro : AttachedMacro
Describes a macro that can add extensions to the declaration it’s attached to.
protocol FreestandingMacro : Macro
Describes a macro that is freestanding, meaning that it is used with the #
syntax.
protocol MemberAttributeMacro : AttachedMacro
Describes a macro that can add attributes to the members inside the declaration it’s attached to.
protocol MemberMacro : AttachedMacro
Describes a macro that can add members to the declaration it’s attached to.
protocol PeerMacro : AttachedMacro
protocol PreambleMacro : AttachedMacro
Describes a macro that can introduce “preamble” code into an existing function body.
import TestingMacros
protocol ConditionMacro : Sendable, ExpressionMacro
A protocol containing the common implementation for the expansions of the #expect()
and #require()
macros.
protocol ExitTestConditionMacro : RefinedConditionMacro
protocol RefinedConditionMacro : ConditionMacro
A protocol that can be used to create a condition macro that refines the behavior of another previously-defined condition macro.