SylvesterInterface

open class SylvesterInterface

Undocumented

  • Undocumented

    Declaration

    Swift

    public static let shared: SylvesterInterface
  • A SourceKitten module info request.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public func moduleInfo(xcodeBuildArguments: [String],
                           name: String? = nil,
                           in path: String) throws -> Module

    Parameters

    xcodeBuildArguments

    The arguments necessary pass in to xcodebuild to build this module.

    name

    The module name. Will be parsed from xcodebuild output if nil.

    path

    The path to run xcodebuild from. Uses current path by default.

    Return Value

    The resulting Module.

  • A SourceKitten module docs request.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public func moduleDocs<S, T>(module: Module) throws -> [T] where S : SKBaseSubstructure, T : SKGenericSwiftDocs<S>

    Parameters

    module

    The Module to get the module docs for.

    Return Value

    An array of the specified SwiftDocs type.

  • A SourceKitten syntax map request.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public func syntaxMap(file: File) throws -> SyntaxMap

    Parameters

    file

    The source file to get a syntax map for.

    Return Value

    The resulting SyntaxMap.

  • A SourceKitten swift documentation request.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public func swiftDocs<Substructure: SKBaseSubstructure>(file: File,
                                                            compilerArguments: [String]) throws
                                                            -> SKGenericSwiftDocs<Substructure>

    Parameters

    file

    The source file to gather documentation for.

    compilerArguments

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

    Return Value

    The resulting SKSwiftDocs.

  • A SourceKitten doc info request.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public func docInfo<Entity: SKBaseEntity>(file: File?,
                                              moduleName: String?,
                                              compilerArguments: [String]) throws
                                             -> SKGenericDocInfo<Entity>

    Parameters

    file

    The source file to gather documentation for.

    compilerArguments

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

    Return Value

    The resulting SKSwiftDocs.

  • A SourceKit cursor info request.

    Important

    The cursor info request requires a valid source file path.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public func cursorInfo(file: File,
                           offset: Int?,
                           usr: String?,
                           compilerArguments: [String],
                           cancelOnSubsequentRequest: Bool) throws -> SKCursorInfo?

    Parameters

    file

    The source file.

    offset

    The byte offset of the code point inside the source contents.

    usr

    The Unified Symbol Resolutions (USR) string for the entity.

    compilerArguments

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

    cancelOnSubsequentRequest

    Whether this request should be canceled if a new cursor-info request is made that uses the same AST. This behavior is a workaround for not having first-class cancelation.

    Return Value

    The resulting SKCursorInfo, or nil if an invalid offset or usr was provided.

  • A SourceKit Markup parsing request.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public func convertMarkupToXML(sourceText: String) throws -> SKSourceTextResponse

    Parameters

    sourceText

    The extracted Markup to parse.

    Return Value

    The Markup parse tree in xml format.

  • A custom YAML SourceKit request.

    Throws

    A SKError, if an error occurs.

    Declaration

    Swift

    public func customYAML<Response>(_ yaml: String) throws -> Response where Response : Decodable

    Parameters

    yaml

    The SourceKit request in YAML representation.

    Return Value

    The decoded response as the specified type.

  • Run xcrun with the specified arguments.

    Declaration

    Swift

    public func xcRun(arguments: [String]) -> String?

    Parameters

    arguments

    The arguments to pass to xcrun.

    Return Value

    The xcrun‘s standard out output.

  • Run xcodebuild clean build along with any passed in build arguments.

    Declaration

    Swift

    public func xcodeBuild(arguments: [String], currentDirectoryURL: URL) -> String?

    Parameters

    arguments

    The arguments to pass to xcodebuild.

    currentDirectoryURL

    The URL to run xcodebuild from.

    Return Value

    The xcodebuild‘s combined standard error and standard out output.

  • Executes a Bash command.

    Declaration

    Swift

    public func executeBash(command: String, currentDirectoryURL: URL? = nil) -> String?

    Parameters

    command

    The command to execute.

    currentDirectoryURL

    The URL to run the Bash command from.

    Return Value

    The Bash command’s standard out output.

  • Launches another program as a subprocess.

    Declaration

    Swift

    public func launch(subprocess: SKSubprocess) throws -> String?

    Parameters

    launchPath

    The path to the receiver’s executable.

    Return Value

    The executable’s standard out (and standard error, if SKSubprocess.shouldPipeStandardError is true) output.