File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
SwiftSyntaxMacroExpansion
SwiftSyntaxMacros/MacroProtocols Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ public func expandAttachedMacroWithoutCollapsing<Context: MacroExpansionContext>
312
312
throw MacroExpansionError . noExtendedTypeSyntax
313
313
}
314
314
315
- // Local function to expand a extension macro once we've opened up
315
+ // Local function to expand an extension macro once we've opened up
316
316
// the existential.
317
317
func expandExtensionMacro(
318
318
_ node: some DeclGroupSyntax
Original file line number Diff line number Diff line change 12
12
13
13
import SwiftSyntax
14
14
15
- /// Describes a macro that can add conformances to the declaration it's
15
+ /// Describes a macro that can add extensions to the declaration it's
16
16
/// attached to.
17
17
public protocol ExtensionMacro : AttachedMacro {
18
- /// Expand an attached conformance macro to produce a set of conformances .
18
+ /// Expand an attached extension macro to produce a set of extensions .
19
19
///
20
20
/// - Parameters:
21
21
/// - node: The custom attribute describing the attached macro.
22
22
/// - declaration: The declaration the macro attribute is attached to.
23
+ /// - type: The type to provide extensions of.
23
24
/// - context: The context in which to perform the macro expansion.
24
25
///
25
- /// - Returns: the set of `(type, where-clause?)` pairs that each provide the
26
- /// protocol type to which the declared type conforms, along with
27
- /// an optional where clause .
26
+ /// - Returns: the set of extension declarations introduced by the macro,
27
+ /// which are always inserted at top-level scope. Each extension must extend
28
+ /// the `type` parameter .
28
29
static func expansion(
29
30
of node: AttributeSyntax ,
30
- attachedTo decl : some DeclGroupSyntax ,
31
+ attachedTo declaration : some DeclGroupSyntax ,
31
32
providingExtensionsOf type: some TypeSyntaxProtocol ,
32
33
in context: some MacroExpansionContext
33
34
) throws -> [ ExtensionDeclSyntax ]
You can’t perform that action at this time.
0 commit comments