AEExtensionKit-Documentation

didOpen

Did open file

Parameters

ParameterTypeDescription
fileStringThe file that was opened.
contentsStringThe file contents.

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "didOpen" {
        if let file = parameters["file"] as? String,
           let contents = parameters["contents"] as? String {
            // Do something
        }
    }

    return true
}

didOpen

Did open file in workspace

Parameters

ParameterTypeDescription
workspaceStringThe current workspace.
fileStringThe file that was opened.
contentsStringThe file contents.

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "didOpen" {
        if let workspace = parameters["workspace"] as? String,
           let file = parameters["file"] as? String,
           let contents = parameters["contents"] as? String {
            // Do something
        }
    }

    return true
}

didSave

Did save file

Parameters

ParameterTypeDescription
fileStringThe file that was opened.

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "didSave" {
        if let file = parameters["file"] as? String {
            // Do something
        }
    }

    return true
}

didMoveCaret

Did move caret to position

Parameters

ParameterTypeDescription
rowIntThe row in the file.
columnIntThe column in the file.

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "didMoveCaret" {
        if let row = parameters["row"] as? Int,
           let column = parameters["column"] as? Int {
            // Do something
        }
    }

    return true
}

didActivateTab

Did activate tab for file

Parameters

ParameterTypeDescription
fileStringThe file that was activated.

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "didActivateTab" {
        if let file = parameters["file"] as? String {
            // Do something
        }
    }

    return true
}

didDeactivateTab

Did close tab for file

Parameters

ParameterTypeDescription
fileStringThe file that was deactivated.

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "didDeactivateTab" {
        if let file = parameters["file"] as? String {
            // Do something
        }
    }

    return true
}

didToggleNavigatorPane

Did toggle navigator pane

Parameters

ParameterTypeDescription
visibleBoolIs the navigator pane visible?

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "didToggleNavigatorPane" {
        if let visible = parameters["visible"] as? Bool {
            // Do something
        }
    }

    return true
}

didToggleInspectorPane

Did toggle inspector pane

Parameters

ParameterTypeDescription
visibleBoolIs the inspector pane visible?

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "didToggleInspectorPane" {
        if let visible = parameters["visible"] as? Bool {
            // Do something
        }
    }

    return true
}

registerCallback

Register AuroraAPI

Parameters

ParameterTypeDescription
callbackAuroraAPI -> BoolAuroraAPI Endpoint

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "registerCallback" {
        if let callback = parameters["callback"] as? AuroraAPI -> Bool {
            // Do something
        }
    }

    return true
}

noop

No Operation (noop)

This is a no operation function
It is used, and as the name suggests, to do nothing

Example Implementation:

public func respond(action: String, parameters: [String: Any]) -> Bool {
    if action == "noop" {
        // Do something
    }

    return true
}