Skip to content

Commit 1e00efc

Browse files
committed
Update method names for all of the Macro protocols
1 parent 2dc73b9 commit 1e00efc

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

Sources/_SwiftSyntaxMacros/MacroProtocols/AccessorMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public protocol AccessorMacro: AttachedMacro {
1919
Declaration: DeclSyntaxProtocol
2020
>(
2121
of node: AttributeSyntax,
22-
attachedTo declaration: Declaration,
22+
providingAccessorsOf declaration: Declaration,
2323
in context: Context
2424
) throws -> [AccessorDeclSyntax]
2525
}

Sources/_SwiftSyntaxMacros/MacroProtocols/MemberAttributeMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public protocol MemberAttributeMacro: AttachedMacro {
3131
>(
3232
of node: AttributeSyntax,
3333
attachedTo declaration: Declaration,
34-
annotating member: DeclSyntax,
34+
providingAttributesFor member: DeclSyntax,
3535
in context: Context
3636
) throws -> [AttributeSyntax]
3737
}

Sources/_SwiftSyntaxMacros/MacroProtocols/MemberMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public protocol MemberMacro: AttachedMacro {
2828
Context: MacroExpansionContext
2929
>(
3030
of node: AttributeSyntax,
31-
attachedTo declaration: Declaration,
31+
providingMembersOf declaration: Declaration,
3232
in context: Context
3333
) throws -> [DeclSyntax]
3434
}

Sources/_SwiftSyntaxMacros/MacroProtocols/PeerMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public protocol PeerMacro: AttachedMacro {
1818
/// the given declaration.
1919
static func expansion<Context: MacroExpansionContext>(
2020
of node: AttributeSyntax,
21-
attachedTo declaration: DeclSyntax,
21+
providingPeersOf declaration: DeclSyntax,
2222
in context: Context
2323
) throws -> [DeclSyntax]
2424
}

Sources/_SwiftSyntaxMacros/MacroSystem.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ class MacroApplication: SyntaxRewriter {
304304
do {
305305
let newAccessors = try accessorMacro.expansion(
306306
of: accessorAttr,
307-
attachedTo: DeclSyntax(visitedNode),
307+
providingAccessorsOf: visitedNode,
308308
in: context
309309
)
310310

@@ -373,7 +373,7 @@ extension MacroApplication {
373373
let macroAttributes = getMacroAttributes(attachedTo: decl, ofType: PeerMacro.Type.self)
374374
for (attribute, peerMacro) in macroAttributes {
375375
do {
376-
let newPeers = try peerMacro.expansion(of: attribute, attachedTo: decl, in: context)
376+
let newPeers = try peerMacro.expansion(of: attribute, providingPeersOf: decl, in: context)
377377
peers.append(contentsOf: newPeers)
378378
} catch {
379379
// Record the error
@@ -401,7 +401,7 @@ extension MacroApplication {
401401
try newMembers.append(
402402
contentsOf: memberMacro.expansion(
403403
of: attribute,
404-
attachedTo: decl,
404+
providingMembersOf: decl,
405405
in: context
406406
)
407407
)
@@ -464,7 +464,7 @@ extension MacroApplication {
464464
return try attributeMacro.expansion(
465465
of: attribute,
466466
attachedTo: decl,
467-
annotating: member.decl,
467+
providingAttributesFor: member.decl,
468468
in: context
469469
)
470470
}

Tests/SwiftSyntaxMacrosTest/MacroSystemTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ extension PropertyWrapper: AccessorMacro {
259259
Declaration: DeclSyntaxProtocol
260260
>(
261261
of node: AttributeSyntax,
262-
attachedTo declaration: Declaration,
262+
providingAccessorsOf declaration: Declaration,
263263
in context: Context
264264
) throws -> [AccessorDeclSyntax] {
265265
guard let varDecl = declaration.as(VariableDeclSyntax.self),
@@ -290,7 +290,7 @@ extension PropertyWrapper: AccessorMacro {
290290
extension PropertyWrapper: PeerMacro {
291291
public static func expansion<Context: MacroExpansionContext>(
292292
of node: AttributeSyntax,
293-
attachedTo declaration: DeclSyntax,
293+
providingPeersOf declaration: DeclSyntax,
294294
in context: Context
295295
) throws -> [SwiftSyntax.DeclSyntax] {
296296
guard let varDecl = declaration.as(VariableDeclSyntax.self),
@@ -327,7 +327,7 @@ extension PropertyWrapper: PeerMacro {
327327
public struct AddCompletionHandler: PeerMacro {
328328
public static func expansion<Context: MacroExpansionContext>(
329329
of node: AttributeSyntax,
330-
attachedTo declaration: DeclSyntax,
330+
providingPeersOf declaration: DeclSyntax,
331331
in context: Context
332332
) throws -> [DeclSyntax] {
333333
// Only on functions at the moment. We could handle initializers as well
@@ -448,7 +448,7 @@ public struct AddBackingStorage: MemberMacro {
448448
Context: MacroExpansionContext
449449
>(
450450
of node: AttributeSyntax,
451-
attachedTo decl: Declaration,
451+
providingMembersOf decl: Declaration,
452452
in context: Context
453453
)
454454
throws -> [DeclSyntax]
@@ -467,7 +467,7 @@ public struct WrapAllProperties: MemberAttributeMacro {
467467
>(
468468
of node: AttributeSyntax,
469469
attachedTo decl: Declaration,
470-
annotating member: DeclSyntax,
470+
providingAttributesFor member: DeclSyntax,
471471
in context: Context
472472
) throws -> [AttributeSyntax] {
473473
guard member.is(VariableDeclSyntax.self) else {
@@ -492,7 +492,7 @@ public struct WrapStoredProperties: MemberAttributeMacro {
492492
>(
493493
of node: AttributeSyntax,
494494
attachedTo decl: Declaration,
495-
annotating member: DeclSyntax,
495+
providingAttributesFor member: DeclSyntax,
496496
in context: Context
497497
) throws -> [AttributeSyntax] {
498498
guard let property = member.as(VariableDeclSyntax.self),
@@ -538,7 +538,7 @@ extension CustomTypeWrapperMacro: MemberMacro {
538538
Context: MacroExpansionContext
539539
>(
540540
of node: AttributeSyntax,
541-
attachedTo declaration: Declaration,
541+
providingMembersOf declaration: Declaration,
542542
in context: Context
543543
) throws -> [DeclSyntax] {
544544
return [
@@ -557,7 +557,7 @@ extension CustomTypeWrapperMacro: MemberAttributeMacro {
557557
>(
558558
of node: AttributeSyntax,
559559
attachedTo declaration: Declaration,
560-
annotating member: DeclSyntax,
560+
providingAttributesFor member: DeclSyntax,
561561
in context: Context
562562
) throws -> [AttributeSyntax] {
563563
return [
@@ -577,7 +577,7 @@ extension CustomTypeWrapperMacro: AccessorMacro {
577577
Declaration: DeclSyntaxProtocol
578578
>(
579579
of node: AttributeSyntax,
580-
attachedTo declaration: Declaration,
580+
providingAccessorsOf declaration: Declaration,
581581
in context: Context
582582
) throws -> [AccessorDeclSyntax] {
583583
guard let property = declaration.as(VariableDeclSyntax.self),

0 commit comments

Comments
 (0)