DeclarationMacro
Describes a macro that forms declarations.
protocol DeclarationMacro : FreestandingMacro
Browse conforming typesDescribes a macro that forms declarations.
protocol DeclarationMacro : FreestandingMacro
import SwiftSyntaxMacros
protocol FreestandingMacro : Macro
Describes a macro that is freestanding, meaning that it is used with the #
syntax.
protocol Macro
Describes a macro.
static var propagateFreestandingMacroAttributes: Bool { get }
Whether to copy attributes on the expansion syntax to expanded declarations, ‘true’ by default.
static var propagateFreestandingMacroModifiers: Bool { get }
Whether to copy modifiers on the expansion syntax to expanded declarations, ‘true’ by default.
static func expansion(of node: some FreestandingMacroExpansionSyntax, in context: some MacroExpansionContext) throws -> [DeclSyntax]
Expand a macro described by the given freestanding macro expansion declaration within the given context to produce a set of declarations.
static var propagateFreestandingMacroAttributes: Bool { get }
static var propagateFreestandingMacroModifiers: Bool { get }