CodeChat_Services.thrift - Define CodeChat services¶
This file defines a set of CodeChat services provided by the CodeChat Server.
Draft sync interface¶
Draft of a Thrift for synchronizing cursor location between the editor/IDE and the CodeChat Client, and for allowing editing of the document in either location. This requires one interface between the editor/IDE extension and the CodeChat Server and another between the CodeChat Client and the CodeChat Server:
Extension service:
void sync_to(string text, uint text_index, uint global_y_coordinate_of_cursor)
uint index, string text, enum result_type { sync, text, request_ownership } = get_results()
returns:The index for the next sync request made in the CodeChat Client. Valid if
result_type == sync
.Updated text for the editor. Valid if
result_type == text
.
void grant_ownswership(int id)
Web browser service. All methods raise an exception if the id isn’t valid.
void sync_to(string text, uint text_index, uint global_y_coordinate_of_cursor)
void request_ownership(int id)
returns when ownership is granted.
Edits may be made in the text editor or in the CodeChat Client. To prevent users from modifying both at the same time, only one of these two places may have editing priviledges. The text editor begins with this priviledge; the CodeChat Client must request and obtain it from the text editor before allowing edits. Privledges return to the text editor when the CodeChat Client sends updated text. What if the text editor changes to another document while the CodeChat Client is still editing? Probably pop up a modal dialog in the web page: save changes or discard changes.
Services for the editor/IDE extension¶
The port used for the Thrift connection between text editor/IDE extensions/plugins and the CodeChat Server. All editor/IDE plugins must use this port to access CodeChat services.
This defines the return value from get_client
.
An HTML string which contains either the render client or an URL for the client.
The ID for this client.
An empty string on success, or an error message.
Define the location of the CodeChat Client; passed as a parameter to get_client
.
A URL, which the CodeChat System will host in its own web browser.
An HTML string, which the CodeChat System will host in its own web browser.
An external browser, which the CodeChat Server should launch.
Provide CodeChat services to editor plugins.
See if the server is running. It returns an empty string on success.
Create a CodeChat Client and return HTML for it and its ID.
The location of the client to return.
Render the provided text as html. Returns an empty string on success, or an error message.
The source code or text to render.
The path to this source file; may be blank for an unnamed file.
id: The ID of the client to render in.
True if the document is dirty (modified), false if clean.
Release all resources associated with a CodeChat Client. Returns an empty string on success, or an error message.
See id.