Skip to content

Commit

Permalink
Parameterize Macro names
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuawright11 committed Nov 27, 2023
1 parent a93ff51 commit cf0a4a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PapyrusPlugin/Sources/APIMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public struct APIMacro: PeerMacro {
throw PapyrusPluginError("@API can only be applied to protocols.")
}

let name = node.firstArgument ?? "\(type.typeName)API"
let name = node.firstArgument ?? "\(type.typeName)\(node.attributeName)"
return try type.createAPI(named: name)
}
}
Expand Down
2 changes: 1 addition & 1 deletion PapyrusPlugin/Sources/MockMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public struct MockMacro: PeerMacro {
throw PapyrusPluginError("@Mock can only be applied to protocols.")
}

let name = node.firstArgument ?? "\(type.typeName)Mock"
let name = node.firstArgument ?? "\(type.typeName)\(node.attributeName)"
return try type.createMock(named: name)
}
}
Expand Down

0 comments on commit cf0a4a1

Please sign in to comment.