From 8a5b85300df32cb2150e69d893f8a23beb419b48 Mon Sep 17 00:00:00 2001 From: Jack Rosen Date: Tue, 16 Jan 2024 12:23:10 -0500 Subject: [PATCH] Add comments by the new strings --- Sources/WhoopDIKitMacros/InjectableMacro.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/WhoopDIKitMacros/InjectableMacro.swift b/Sources/WhoopDIKitMacros/InjectableMacro.swift index 40d2a9a..1b2085c 100644 --- a/Sources/WhoopDIKitMacros/InjectableMacro.swift +++ b/Sources/WhoopDIKitMacros/InjectableMacro.swift @@ -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)