Skip to content

Commit 3e2c782

Browse files
committed
[Macros] Fix typos in comments and documentation for extension macros.
1 parent 1286637 commit 3e2c782

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Sources/SwiftSyntaxMacroExpansion/MacroExpansion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ public func expandAttachedMacroWithoutCollapsing<Context: MacroExpansionContext>
312312
throw MacroExpansionError.noExtendedTypeSyntax
313313
}
314314

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
316316
// the existential.
317317
func expandExtensionMacro(
318318
_ node: some DeclGroupSyntax

Sources/SwiftSyntaxMacros/MacroProtocols/ExtensionMacro.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@
1212

1313
import SwiftSyntax
1414

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
1616
/// attached to.
1717
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.
1919
///
2020
/// - Parameters:
2121
/// - node: The custom attribute describing the attached macro.
2222
/// - declaration: The declaration the macro attribute is attached to.
23+
/// - type: The type to provide extensions of.
2324
/// - context: The context in which to perform the macro expansion.
2425
///
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.
2829
static func expansion(
2930
of node: AttributeSyntax,
30-
attachedTo decl: some DeclGroupSyntax,
31+
attachedTo declaration: some DeclGroupSyntax,
3132
providingExtensionsOf type: some TypeSyntaxProtocol,
3233
in context: some MacroExpansionContext
3334
) throws -> [ExtensionDeclSyntax]

0 commit comments

Comments
 (0)