Did open file
Parameters
| Parameter | Type | Description | 
|---|---|---|
| file | String | The file that was opened. | 
| contents | String | The 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
}
Did open file in workspace
Parameters
| Parameter | Type | Description | 
|---|---|---|
| workspace | String | The current workspace. | 
| file | String | The file that was opened. | 
| contents | String | The 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
}
Did save file
Parameters
| Parameter | Type | Description | 
|---|---|---|
| file | String | The 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
}
Did move caret to position
Parameters
| Parameter | Type | Description | 
|---|---|---|
| row | Int | The row in the file. | 
| column | Int | The 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
}
Did activate tab for file
Parameters
| Parameter | Type | Description | 
|---|---|---|
| file | String | The 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
}
Did close tab for file
Parameters
| Parameter | Type | Description | 
|---|---|---|
| file | String | The 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
}
Did toggle navigator pane
Parameters
| Parameter | Type | Description | 
|---|---|---|
| visible | Bool | Is 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
}
Did toggle inspector pane
Parameters
| Parameter | Type | Description | 
|---|---|---|
| visible | Bool | Is 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
}
Register AuroraAPI
Parameters
| Parameter | Type | Description | 
|---|---|---|
| callback | AuroraAPI -> Bool | AuroraAPI 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
}
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
}