SylvesterInterface
open class SylvesterInterface
Undocumented
-
Undocumented
Declaration
Swift
public static let shared: SylvesterInterface
-
A SourceKitten module info request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func moduleInfo(xcodeBuildArguments: [String], name: String? = nil, in path: String) throws -> ModuleParameters
xcodeBuildArgumentsThe arguments necessary pass in to
xcodebuildto build this module.nameThe module name. Will be parsed from
xcodebuildoutput if nil.pathThe path to run
xcodebuildfrom. Uses current path by default.Return Value
The resulting
Module. -
A SourceKitten module docs request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func moduleDocs<S, T>(module: Module) throws -> [T] where S : SKBaseSubstructure, T : SKGenericSwiftDocs<S>Parameters
moduleThe
Moduleto get the module docs for.Return Value
An array of the specified
SwiftDocstype.
-
A SourceKit editor open request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func editorOpen<Substructure: SKBaseSubstructure>(file: File) throws -> SKGenericEditorOpen<Substructure>Parameters
fileThe source file to open.
Return Value
The resulting
SKEditorOpen. -
A SourceKit editor text extraction request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func editorExtractTextFromComment(sourceText: String) throws -> SKSourceTextResponseParameters
sourceTextThe raw comment to extract the text from.
Return Value
The text extracted from a source comment.
-
A SourceKitten syntax map request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func syntaxMap(file: File) throws -> SyntaxMapParameters
fileThe source file to get a syntax map for.
Return Value
The resulting
SyntaxMap.
-
A SourceKitten swift documentation request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func swiftDocs<Substructure: SKBaseSubstructure>(file: File, compilerArguments: [String]) throws -> SKGenericSwiftDocs<Substructure>Parameters
fileThe source file to gather documentation for.
compilerArgumentsThe compiler arguments used to build the module (e.g
["-sdk", "/path/to/sdk"]).Return Value
The resulting
SKSwiftDocs. -
A SourceKitten doc info request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func docInfo<Entity: SKBaseEntity>(file: File?, moduleName: String?, compilerArguments: [String]) throws -> SKGenericDocInfo<Entity>Parameters
fileThe source file to gather documentation for.
compilerArgumentsThe compiler arguments used to build the module (e.g
["-sdk", "/path/to/sdk"]).Return Value
The resulting
SKSwiftDocs.
-
A SourceKit code completion request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func codeCompletion(file: File, offset: Offset, compilerArguments: [String]) throws -> SKCodeCompletionParameters
fileThe
Fileof the code completion.offsetThe byte offset of the code completion point inside the source contents.
compilerArgumentsThe compiler arguments used to build the module (e.g
["-sdk", "/path/to/sdk"]).Return Value
The resulting
SKCodeCompletion. -
A SourceKit code completion open request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func codeCompletionOpen(file: File, offset: Offset, options: SKCodeCompletionSession.Options?, compilerArguments: [String]) throws -> SKCodeCompletionSession.ResponseParameters
fileThe
Fileof the code completion session.offsetThe byte offset of the code completion point inside the session’s source contents.
optionsThe
SKCodeCompletionSession.Optionsof the open request.compilerArgumentsThe compiler arguments used to build the module (e.g
["-sdk", "/path/to/sdk"]).Return Value
The request’s
SKCodeCompletionSession.Response. -
A SourceKit code completion update request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func codeCompletionUpdate(file: File, offset: Int, options: SKCodeCompletionSession.Options?) throws -> SKCodeCompletionSession.ResponseParameters
fileThe
Fileof the open code completion session.offsetThe byte offset of the code completion point inside the session’s source contents.
optionsThe
SKCodeCompletionSession.Optionsof the update request.Return Value
The request’s
SKCodeCompletionSession.Response. -
A SourceKit code completion close request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func codeCompletionClose(name: String, offset: Int) throws -> SKCodeCompletionSession.ResponseParameters
nameThe name of the open code completion session.
offsetThe byte offset of the code completion point inside the session’s source contents.
Return Value
The request’s
SKCodeCompletionSession.Response.
-
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
fileThe source file.
offsetThe byte offset of the code point inside the source contents.
usrThe Unified Symbol Resolutions (USR) string for the entity.
compilerArgumentsThe compiler arguments used to build the module (e.g
["-sdk", "/path/to/sdk"]). These must include the path to the file.cancelOnSubsequentRequestWhether 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, ornilif an invalidoffsetorusrwas provided.
-
A SourceKit Markup parsing request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func convertMarkupToXML(sourceText: String) throws -> SKSourceTextResponseParameters
sourceTextThe extracted Markup to parse.
Return Value
The Markup parse tree in xml format.
-
A custom YAML SourceKit request.
Throws
ASKError, if an error occurs.Declaration
Swift
public func customYAML<Response>(_ yaml: String) throws -> Response where Response : DecodableParameters
yamlThe SourceKit request in YAML representation.
Return Value
The decoded response as the specified type.
-
Run
xcrunwith the specified arguments.Declaration
Swift
public func xcRun(arguments: [String]) -> String?Parameters
argumentsThe arguments to pass to
xcrun.Return Value
The
xcrun‘s standard out output. -
Run
xcodebuild clean buildalong with any passed in build arguments.Declaration
Swift
public func xcodeBuild(arguments: [String], currentDirectoryURL: URL) -> String?Parameters
argumentsThe arguments to pass to
xcodebuild.currentDirectoryURLThe URL to run
xcodebuildfrom.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
commandThe command to execute.
currentDirectoryURLThe 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
launchPathThe path to the receiver’s executable.
Return Value
The executable’s standard out (and standard error, if
SKSubprocess.shouldPipeStandardErroris true) output.
SylvesterInterface Class Reference