Skip to content

Commit

Permalink
Add comments by the new strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jrosen081 committed Jan 16, 2024
1 parent 4829408 commit 8a5b853
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/WhoopDIKitMacros/InjectableMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,20 @@ struct InjectableMacro: ExtensionMacro, MemberMacro {
let accessLevel = self.accessLevel(declaration: declaration) ?? "internal"

return [
/// Adds the static inject function, such as:
/// public static func inject() -> Self {
/// Self.init(myValue: WhoopDI.inject(nil))
/// }
"""
\(raw: accessLevel) static func inject() -> Self {
Self.init(\(raw: injectingVariables))
}
""",
/// Adds the memberwise init, such as:
/// public init(myValue: String) {
/// self.myValue = myValue
/// }
"""
\(raw: accessLevel) init(\(raw: initializerArgs)) {
\(raw: initializerStoring)
Expand Down

0 comments on commit 8a5b853

Please sign in to comment.