expansion(of:attachedTo:providingAttributesFor:in:)

Expand an attached declaration macro to produce an attribute list for a given member.

MemberAttributeMacro.swift:32
static func expansion(of node: AttributeSyntax, attachedTo declaration: some DeclGroupSyntax, providingAttributesFor member: some DeclSyntaxProtocol, in context: some MacroExpansionContext) throws -> [AttributeSyntax]

Parameters

node

The custom attribute describing the attached macro.

declaration

The declaration the macro attribute is attached to.

member

The member declaration to attach the resulting attributes to.

context

The context in which to perform the macro expansion.

Returns

the set of attributes to apply to the given member.