From 67e94f23a77be610b4f9da253e4c2e6de73ebbdc Mon Sep 17 00:00:00 2001 From: chriszielinski Date: Wed, 30 Jan 2019 22:38:27 -0800 Subject: [PATCH] Refactor 'SKGenericDocInfo' designated initializer's access level to public --- Source/Requests/Doc Info/SKGenericDocInfo.swift | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Source/Requests/Doc Info/SKGenericDocInfo.swift b/Source/Requests/Doc Info/SKGenericDocInfo.swift index 7662d12..5e0b18e 100644 --- a/Source/Requests/Doc Info/SKGenericDocInfo.swift +++ b/Source/Requests/Doc Info/SKGenericDocInfo.swift @@ -35,9 +35,20 @@ open class SKGenericDocInfo: NSObject, Codable { /// - Note: This key is only present if a diagnostic was emitted public let diagnostics: [SKDiagnostic]? - // MARK: - Private Initializers + // MARK: - Public Initializers - private init(file: File?, moduleName: String?, compilerArguments: [String]) throws { + /// Creates a new synchronous _SourceKit_ doc info request. + /// + /// - Warning: The request is sent synchronously, so ensure this initializer is not called on the main thread. + /// + /// - Note: Ensure this initializer is only called with either a `file` or a `moduleName`, **not both**. + /// + /// - Parameters: + /// - file: The source file to gather documentation for. + /// - moduleName: The module name to gather documentation for. + /// - compilerArguments: The compiler arguments used to build the module (e.g `["-sdk", "/path/to/sdk"]`). + /// - Throws: A `SKError`, if an error occurs. + public init(file: File?, moduleName: String?, compilerArguments: [String]) throws { let sharedInterface = SylvesterInterface.shared let response: SKGenericDocInfo = try sharedInterface.docInfo(file: file, moduleName: moduleName, @@ -53,8 +64,6 @@ open class SKGenericDocInfo: NSObject, Codable { resolve(from: file?.path) } - // MARK: - Public Initializers - /// Creates a new synchronous _SourceKit_ doc info request. /// /// - Warning: The request is sent synchronously, so ensure this initializer is not called on the main thread.