SKGenericDocInfo

open class SKGenericDocInfo<Entity> : NSObject, Codable where Entity : SKBaseEntity

A generic SourceKit doc info request.

  • The source contents.

    Declaration

    Swift

    public let sourceText: String?
  • An array of annotations for the tokens of source text.

    Declaration

    Swift

    public let annotations: SKSortedEntities<SKAnnotation>
  • A structure of the symbols (a class has its methods as sub-entities, etc.).

    This includes the function parameters and their types as entities.

    Declaration

    Swift

    public let topLevelEntities: SKChildren<Entity>?
  • The Compiler diagnostics emitted during parsing of a source file.

    Note

    This key is only present if a diagnostic was emitted

    Declaration

    Swift

    public let diagnostics: [SKDiagnostic]?
  • 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.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public init(file: File?, moduleName: String?, compilerArguments: [String]) throws

    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"]).

  • 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.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public convenience init(file: File, compilerArguments: [String]) throws

    Parameters

    file

    The source file to gather documentation for.

    compilerArguments

    The compiler arguments used to build the module (e.g ["-sdk", "/path/to/sdk"]).

  • 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.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public convenience init(file: File, sdkPath: String, target: String?) throws

    Parameters

    file

    The source file to gather documentation for.

    sdkPath

    The path to the SDK to compile against.

    target

    The target (triple) architecture (e.g. "arm64-apple-ios12.1").

  • 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.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public convenience init(moduleName: String, compilerArguments: [String]) throws

    Parameters

    moduleName

    The module name to gather documentation for.

    compilerArguments

    The compiler arguments used to build the module (e.g ["-sdk", "/path/to/sdk"]).

  • 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.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public convenience init(moduleName: String, sdkPath: String, target: String?) throws

    Parameters

    moduleName

    The module name to gather documentation for.

    sdkPath

    The path to the SDK to compile against.

    target

    The target (triple) architecture (e.g. "arm64-apple-ios12.1").

  • The entry point to a recursive resolution process that sets each child’s index, parent, and filePath properties.

    This method calls the topLevelEntities‘s SKChildren.resolve(parent:index:filePath:) method.

    Note

    If the resolution process is unnecessary, overriding this method with an empty body will suffice to omit it.

    Declaration

    Swift

    open func resolve(from filePath: String?)

    Parameters

    filePath

    The absolute file path to the request’s source file.