mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-26 03:59:55 +00:00
9c9bf07e40
Previously, we would use `Project::serialize_buffer_for_peer` and `Project::deserialize_buffer` respectively in the host and in the guest to create a new buffer or just send its ID if the host thought the buffer had already been sent. These methods would be called as part of other methods, such as `Project::open_buffer_by_id` or `Project::open_buffer_for_symbol`. However, if any of the tasks driving the futures that eventually called `Project::deserialize_buffer` were dropped after the host responded with the buffer state but (crucially) before the guest deserialized it and registered it, there could be a situation where the host thought the guest had the buffer (thus sending them just the buffer id) and the guest would wait indefinitely. Given how crucial this interaction is, this commit switches to creating remote buffers for peers out of band. The host will push buffers to guests, who will always refer to buffers via IDs and wait for the host to send them, as opposed to including the buffer's payload as part of some other operation.
983 lines
21 KiB
Protocol Buffer
983 lines
21 KiB
Protocol Buffer
syntax = "proto3";
|
|
package zed.messages;
|
|
|
|
message Envelope {
|
|
uint32 id = 1;
|
|
optional uint32 responding_to = 2;
|
|
optional uint32 original_sender_id = 3;
|
|
oneof payload {
|
|
Ack ack = 4;
|
|
Error error = 5;
|
|
Ping ping = 6;
|
|
Test test = 7;
|
|
|
|
RegisterProject register_project = 8;
|
|
RegisterProjectResponse register_project_response = 9;
|
|
UnregisterProject unregister_project = 10;
|
|
RequestJoinProject request_join_project = 11;
|
|
RespondToJoinProjectRequest respond_to_join_project_request = 12;
|
|
JoinProjectRequestCancelled join_project_request_cancelled = 13;
|
|
JoinProject join_project = 14;
|
|
JoinProjectResponse join_project_response = 15;
|
|
LeaveProject leave_project = 16;
|
|
AddProjectCollaborator add_project_collaborator = 17;
|
|
RemoveProjectCollaborator remove_project_collaborator = 18;
|
|
ProjectUnshared project_unshared = 19;
|
|
|
|
GetDefinition get_definition = 20;
|
|
GetDefinitionResponse get_definition_response = 21;
|
|
GetTypeDefinition get_type_definition = 22;
|
|
GetTypeDefinitionResponse get_type_definition_response = 23;
|
|
GetReferences get_references = 24;
|
|
GetReferencesResponse get_references_response = 25;
|
|
GetDocumentHighlights get_document_highlights = 26;
|
|
GetDocumentHighlightsResponse get_document_highlights_response = 27;
|
|
GetProjectSymbols get_project_symbols = 28;
|
|
GetProjectSymbolsResponse get_project_symbols_response = 29;
|
|
OpenBufferForSymbol open_buffer_for_symbol = 30;
|
|
OpenBufferForSymbolResponse open_buffer_for_symbol_response = 31;
|
|
|
|
UpdateProject update_project = 32;
|
|
RegisterProjectActivity register_project_activity = 33;
|
|
UpdateWorktree update_worktree = 34;
|
|
UpdateWorktreeExtensions update_worktree_extensions = 35;
|
|
|
|
CreateProjectEntry create_project_entry = 36;
|
|
RenameProjectEntry rename_project_entry = 37;
|
|
CopyProjectEntry copy_project_entry = 38;
|
|
DeleteProjectEntry delete_project_entry = 39;
|
|
ProjectEntryResponse project_entry_response = 40;
|
|
|
|
UpdateDiagnosticSummary update_diagnostic_summary = 41;
|
|
StartLanguageServer start_language_server = 42;
|
|
UpdateLanguageServer update_language_server = 43;
|
|
|
|
OpenBufferById open_buffer_by_id = 44;
|
|
OpenBufferByPath open_buffer_by_path = 45;
|
|
OpenBufferResponse open_buffer_response = 46;
|
|
CreateBufferForPeer create_buffer_for_peer = 47;
|
|
UpdateBuffer update_buffer = 48;
|
|
UpdateBufferFile update_buffer_file = 49;
|
|
SaveBuffer save_buffer = 50;
|
|
BufferSaved buffer_saved = 51;
|
|
BufferReloaded buffer_reloaded = 52;
|
|
ReloadBuffers reload_buffers = 53;
|
|
ReloadBuffersResponse reload_buffers_response = 54;
|
|
FormatBuffers format_buffers = 55;
|
|
FormatBuffersResponse format_buffers_response = 56;
|
|
GetCompletions get_completions = 57;
|
|
GetCompletionsResponse get_completions_response = 58;
|
|
ApplyCompletionAdditionalEdits apply_completion_additional_edits = 59;
|
|
ApplyCompletionAdditionalEditsResponse apply_completion_additional_edits_response = 60;
|
|
GetCodeActions get_code_actions = 61;
|
|
GetCodeActionsResponse get_code_actions_response = 62;
|
|
GetHover get_hover = 63;
|
|
GetHoverResponse get_hover_response = 64;
|
|
ApplyCodeAction apply_code_action = 65;
|
|
ApplyCodeActionResponse apply_code_action_response = 66;
|
|
PrepareRename prepare_rename = 67;
|
|
PrepareRenameResponse prepare_rename_response = 68;
|
|
PerformRename perform_rename = 69;
|
|
PerformRenameResponse perform_rename_response = 70;
|
|
SearchProject search_project = 71;
|
|
SearchProjectResponse search_project_response = 72;
|
|
|
|
GetChannels get_channels = 73;
|
|
GetChannelsResponse get_channels_response = 74;
|
|
JoinChannel join_channel = 75;
|
|
JoinChannelResponse join_channel_response = 76;
|
|
LeaveChannel leave_channel = 77;
|
|
SendChannelMessage send_channel_message = 78;
|
|
SendChannelMessageResponse send_channel_message_response = 79;
|
|
ChannelMessageSent channel_message_sent = 80;
|
|
GetChannelMessages get_channel_messages = 81;
|
|
GetChannelMessagesResponse get_channel_messages_response = 82;
|
|
|
|
UpdateContacts update_contacts = 83;
|
|
UpdateInviteInfo update_invite_info = 84;
|
|
ShowContacts show_contacts = 85;
|
|
|
|
GetUsers get_users = 86;
|
|
FuzzySearchUsers fuzzy_search_users = 87;
|
|
UsersResponse users_response = 88;
|
|
RequestContact request_contact = 89;
|
|
RespondToContactRequest respond_to_contact_request = 90;
|
|
RemoveContact remove_contact = 91;
|
|
|
|
Follow follow = 92;
|
|
FollowResponse follow_response = 93;
|
|
UpdateFollowers update_followers = 94;
|
|
Unfollow unfollow = 95;
|
|
}
|
|
}
|
|
|
|
// Messages
|
|
|
|
message Ping {}
|
|
|
|
message Ack {}
|
|
|
|
message Error {
|
|
string message = 1;
|
|
}
|
|
|
|
message Test {
|
|
uint64 id = 1;
|
|
}
|
|
|
|
message RegisterProject {
|
|
bool online = 1;
|
|
}
|
|
|
|
message RegisterProjectResponse {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message UnregisterProject {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message UpdateProject {
|
|
uint64 project_id = 1;
|
|
repeated WorktreeMetadata worktrees = 2;
|
|
bool online = 3;
|
|
}
|
|
|
|
message RegisterProjectActivity {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message RequestJoinProject {
|
|
uint64 requester_id = 1;
|
|
uint64 project_id = 2;
|
|
}
|
|
|
|
message RespondToJoinProjectRequest {
|
|
uint64 requester_id = 1;
|
|
uint64 project_id = 2;
|
|
bool allow = 3;
|
|
}
|
|
|
|
message JoinProjectRequestCancelled {
|
|
uint64 requester_id = 1;
|
|
uint64 project_id = 2;
|
|
}
|
|
|
|
message JoinProject {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message JoinProjectResponse {
|
|
oneof variant {
|
|
Accept accept = 1;
|
|
Decline decline = 2;
|
|
}
|
|
|
|
message Accept {
|
|
uint32 replica_id = 1;
|
|
repeated WorktreeMetadata worktrees = 2;
|
|
repeated Collaborator collaborators = 3;
|
|
repeated LanguageServer language_servers = 4;
|
|
}
|
|
|
|
message Decline {
|
|
Reason reason = 1;
|
|
|
|
enum Reason {
|
|
Declined = 0;
|
|
Closed = 1;
|
|
WentOffline = 2;
|
|
}
|
|
}
|
|
}
|
|
|
|
message LeaveProject {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message UpdateWorktree {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
string root_name = 3;
|
|
repeated Entry updated_entries = 4;
|
|
repeated uint64 removed_entries = 5;
|
|
uint64 scan_id = 6;
|
|
bool is_last_update = 7;
|
|
}
|
|
|
|
message UpdateWorktreeExtensions {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
repeated string extensions = 3;
|
|
repeated uint32 counts = 4;
|
|
}
|
|
|
|
message CreateProjectEntry {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
bytes path = 3;
|
|
bool is_directory = 4;
|
|
}
|
|
|
|
message RenameProjectEntry {
|
|
uint64 project_id = 1;
|
|
uint64 entry_id = 2;
|
|
bytes new_path = 3;
|
|
}
|
|
|
|
message CopyProjectEntry {
|
|
uint64 project_id = 1;
|
|
uint64 entry_id = 2;
|
|
bytes new_path = 3;
|
|
}
|
|
|
|
message DeleteProjectEntry {
|
|
uint64 project_id = 1;
|
|
uint64 entry_id = 2;
|
|
}
|
|
|
|
message ProjectEntryResponse {
|
|
Entry entry = 1;
|
|
uint64 worktree_scan_id = 2;
|
|
}
|
|
|
|
message AddProjectCollaborator {
|
|
uint64 project_id = 1;
|
|
Collaborator collaborator = 2;
|
|
}
|
|
|
|
message RemoveProjectCollaborator {
|
|
uint64 project_id = 1;
|
|
uint32 peer_id = 2;
|
|
}
|
|
|
|
message ProjectUnshared {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message GetDefinition {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
repeated VectorClockEntry version = 4;
|
|
}
|
|
|
|
message GetDefinitionResponse {
|
|
repeated LocationLink links = 1;
|
|
}
|
|
|
|
message GetTypeDefinition {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
repeated VectorClockEntry version = 4;
|
|
}
|
|
|
|
message GetTypeDefinitionResponse {
|
|
repeated LocationLink links = 1;
|
|
}
|
|
|
|
message GetReferences {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
repeated VectorClockEntry version = 4;
|
|
}
|
|
|
|
message GetReferencesResponse {
|
|
repeated Location locations = 1;
|
|
}
|
|
|
|
message GetDocumentHighlights {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
repeated VectorClockEntry version = 4;
|
|
}
|
|
|
|
message GetDocumentHighlightsResponse {
|
|
repeated DocumentHighlight highlights = 1;
|
|
}
|
|
|
|
message Location {
|
|
uint64 buffer_id = 1;
|
|
Anchor start = 2;
|
|
Anchor end = 3;
|
|
}
|
|
|
|
message LocationLink {
|
|
optional Location origin = 1;
|
|
Location target = 2;
|
|
}
|
|
|
|
message DocumentHighlight {
|
|
Kind kind = 1;
|
|
Anchor start = 2;
|
|
Anchor end = 3;
|
|
|
|
enum Kind {
|
|
Text = 0;
|
|
Read = 1;
|
|
Write = 2;
|
|
}
|
|
}
|
|
|
|
message GetProjectSymbols {
|
|
uint64 project_id = 1;
|
|
string query = 2;
|
|
}
|
|
|
|
message GetProjectSymbolsResponse {
|
|
repeated Symbol symbols = 4;
|
|
}
|
|
|
|
message Symbol {
|
|
uint64 source_worktree_id = 1;
|
|
uint64 worktree_id = 2;
|
|
string language_server_name = 3;
|
|
string name = 4;
|
|
int32 kind = 5;
|
|
string path = 6;
|
|
Point start = 7;
|
|
Point end = 8;
|
|
bytes signature = 9;
|
|
}
|
|
|
|
message OpenBufferForSymbol {
|
|
uint64 project_id = 1;
|
|
Symbol symbol = 2;
|
|
}
|
|
|
|
message OpenBufferForSymbolResponse {
|
|
uint64 buffer_id = 1;
|
|
}
|
|
|
|
message OpenBufferByPath {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
string path = 3;
|
|
}
|
|
|
|
message OpenBufferById {
|
|
uint64 project_id = 1;
|
|
uint64 id = 2;
|
|
}
|
|
|
|
message OpenBufferResponse {
|
|
uint64 buffer_id = 1;
|
|
}
|
|
|
|
message CreateBufferForPeer {
|
|
uint64 project_id = 1;
|
|
uint32 peer_id = 2;
|
|
Buffer buffer = 3;
|
|
}
|
|
|
|
message UpdateBuffer {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
repeated Operation operations = 3;
|
|
}
|
|
|
|
message UpdateBufferFile {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
File file = 3;
|
|
}
|
|
|
|
message SaveBuffer {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
repeated VectorClockEntry version = 3;
|
|
}
|
|
|
|
message BufferSaved {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
repeated VectorClockEntry version = 3;
|
|
Timestamp mtime = 4;
|
|
string fingerprint = 5;
|
|
}
|
|
|
|
message BufferReloaded {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
repeated VectorClockEntry version = 3;
|
|
Timestamp mtime = 4;
|
|
string fingerprint = 5;
|
|
LineEnding line_ending = 6;
|
|
}
|
|
|
|
message ReloadBuffers {
|
|
uint64 project_id = 1;
|
|
repeated uint64 buffer_ids = 2;
|
|
}
|
|
|
|
message ReloadBuffersResponse {
|
|
ProjectTransaction transaction = 1;
|
|
}
|
|
|
|
message FormatBuffers {
|
|
uint64 project_id = 1;
|
|
repeated uint64 buffer_ids = 2;
|
|
}
|
|
|
|
message FormatBuffersResponse {
|
|
ProjectTransaction transaction = 1;
|
|
}
|
|
|
|
message GetCompletions {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
repeated VectorClockEntry version = 4;
|
|
}
|
|
|
|
message GetCompletionsResponse {
|
|
repeated Completion completions = 1;
|
|
repeated VectorClockEntry version = 2;
|
|
}
|
|
|
|
message ApplyCompletionAdditionalEdits {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Completion completion = 3;
|
|
}
|
|
|
|
message ApplyCompletionAdditionalEditsResponse {
|
|
Transaction transaction = 1;
|
|
}
|
|
|
|
message Completion {
|
|
Anchor old_start = 1;
|
|
Anchor old_end = 2;
|
|
string new_text = 3;
|
|
bytes lsp_completion = 4;
|
|
}
|
|
|
|
message GetCodeActions {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor start = 3;
|
|
Anchor end = 4;
|
|
repeated VectorClockEntry version = 5;
|
|
}
|
|
|
|
message GetCodeActionsResponse {
|
|
repeated CodeAction actions = 1;
|
|
repeated VectorClockEntry version = 2;
|
|
}
|
|
|
|
message GetHover {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
repeated VectorClockEntry version = 5;
|
|
}
|
|
|
|
message GetHoverResponse {
|
|
optional Anchor start = 1;
|
|
optional Anchor end = 2;
|
|
repeated HoverBlock contents = 3;
|
|
}
|
|
|
|
message HoverBlock {
|
|
string text = 1;
|
|
optional string language = 2;
|
|
}
|
|
|
|
message ApplyCodeAction {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
CodeAction action = 3;
|
|
}
|
|
|
|
message ApplyCodeActionResponse {
|
|
ProjectTransaction transaction = 1;
|
|
}
|
|
|
|
message PrepareRename {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
repeated VectorClockEntry version = 4;
|
|
}
|
|
|
|
message PrepareRenameResponse {
|
|
bool can_rename = 1;
|
|
Anchor start = 2;
|
|
Anchor end = 3;
|
|
repeated VectorClockEntry version = 4;
|
|
}
|
|
|
|
message PerformRename {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
string new_name = 4;
|
|
repeated VectorClockEntry version = 5;
|
|
}
|
|
|
|
message PerformRenameResponse {
|
|
ProjectTransaction transaction = 2;
|
|
}
|
|
|
|
message SearchProject {
|
|
uint64 project_id = 1;
|
|
string query = 2;
|
|
bool regex = 3;
|
|
bool whole_word = 4;
|
|
bool case_sensitive = 5;
|
|
}
|
|
|
|
message SearchProjectResponse {
|
|
repeated Location locations = 1;
|
|
}
|
|
|
|
message CodeAction {
|
|
Anchor start = 1;
|
|
Anchor end = 2;
|
|
bytes lsp_action = 3;
|
|
}
|
|
|
|
message ProjectTransaction {
|
|
repeated uint64 buffer_ids = 1;
|
|
repeated Transaction transactions = 2;
|
|
}
|
|
|
|
message Transaction {
|
|
LocalTimestamp id = 1;
|
|
repeated LocalTimestamp edit_ids = 2;
|
|
repeated VectorClockEntry start = 3;
|
|
}
|
|
|
|
message LocalTimestamp {
|
|
uint32 replica_id = 1;
|
|
uint32 value = 2;
|
|
}
|
|
|
|
message LanguageServer {
|
|
uint64 id = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
message StartLanguageServer {
|
|
uint64 project_id = 1;
|
|
LanguageServer server = 2;
|
|
}
|
|
|
|
message UpdateDiagnosticSummary {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
DiagnosticSummary summary = 3;
|
|
}
|
|
|
|
message DiagnosticSummary {
|
|
string path = 1;
|
|
uint64 language_server_id = 2;
|
|
uint32 error_count = 3;
|
|
uint32 warning_count = 4;
|
|
}
|
|
|
|
message UpdateLanguageServer {
|
|
uint64 project_id = 1;
|
|
uint64 language_server_id = 2;
|
|
oneof variant {
|
|
LspWorkStart work_start = 3;
|
|
LspWorkProgress work_progress = 4;
|
|
LspWorkEnd work_end = 5;
|
|
LspDiskBasedDiagnosticsUpdating disk_based_diagnostics_updating = 6;
|
|
LspDiskBasedDiagnosticsUpdated disk_based_diagnostics_updated = 7;
|
|
}
|
|
}
|
|
|
|
message LspWorkStart {
|
|
string token = 1;
|
|
optional string message = 2;
|
|
optional uint32 percentage = 3;
|
|
}
|
|
|
|
message LspWorkProgress {
|
|
string token = 1;
|
|
optional string message = 2;
|
|
optional uint32 percentage = 3;
|
|
}
|
|
|
|
message LspWorkEnd {
|
|
string token = 1;
|
|
}
|
|
|
|
message LspDiskBasedDiagnosticsUpdating {}
|
|
|
|
message LspDiskBasedDiagnosticsUpdated {}
|
|
|
|
message GetChannels {}
|
|
|
|
message GetChannelsResponse {
|
|
repeated Channel channels = 1;
|
|
}
|
|
|
|
message JoinChannel {
|
|
uint64 channel_id = 1;
|
|
}
|
|
|
|
message JoinChannelResponse {
|
|
repeated ChannelMessage messages = 1;
|
|
bool done = 2;
|
|
}
|
|
|
|
message LeaveChannel {
|
|
uint64 channel_id = 1;
|
|
}
|
|
|
|
message GetUsers {
|
|
repeated uint64 user_ids = 1;
|
|
}
|
|
|
|
message FuzzySearchUsers {
|
|
string query = 1;
|
|
}
|
|
|
|
message UsersResponse {
|
|
repeated User users = 1;
|
|
}
|
|
|
|
message RequestContact {
|
|
uint64 responder_id = 1;
|
|
}
|
|
|
|
message RemoveContact {
|
|
uint64 user_id = 1;
|
|
}
|
|
|
|
message RespondToContactRequest {
|
|
uint64 requester_id = 1;
|
|
ContactRequestResponse response = 2;
|
|
}
|
|
|
|
enum ContactRequestResponse {
|
|
Accept = 0;
|
|
Decline = 1;
|
|
Block = 2;
|
|
Dismiss = 3;
|
|
}
|
|
|
|
message SendChannelMessage {
|
|
uint64 channel_id = 1;
|
|
string body = 2;
|
|
Nonce nonce = 3;
|
|
}
|
|
|
|
message SendChannelMessageResponse {
|
|
ChannelMessage message = 1;
|
|
}
|
|
|
|
message ChannelMessageSent {
|
|
uint64 channel_id = 1;
|
|
ChannelMessage message = 2;
|
|
}
|
|
|
|
message GetChannelMessages {
|
|
uint64 channel_id = 1;
|
|
uint64 before_message_id = 2;
|
|
}
|
|
|
|
message GetChannelMessagesResponse {
|
|
repeated ChannelMessage messages = 1;
|
|
bool done = 2;
|
|
}
|
|
|
|
message UpdateContacts {
|
|
repeated Contact contacts = 1;
|
|
repeated uint64 remove_contacts = 2;
|
|
repeated IncomingContactRequest incoming_requests = 3;
|
|
repeated uint64 remove_incoming_requests = 4;
|
|
repeated uint64 outgoing_requests = 5;
|
|
repeated uint64 remove_outgoing_requests = 6;
|
|
}
|
|
|
|
message UpdateInviteInfo {
|
|
string url = 1;
|
|
uint32 count = 2;
|
|
}
|
|
|
|
message ShowContacts {}
|
|
|
|
message IncomingContactRequest {
|
|
uint64 requester_id = 1;
|
|
bool should_notify = 2;
|
|
}
|
|
|
|
message UpdateDiagnostics {
|
|
uint32 replica_id = 1;
|
|
uint32 lamport_timestamp = 2;
|
|
repeated Diagnostic diagnostics = 3;
|
|
}
|
|
|
|
message Follow {
|
|
uint64 project_id = 1;
|
|
uint32 leader_id = 2;
|
|
}
|
|
|
|
message FollowResponse {
|
|
optional uint64 active_view_id = 1;
|
|
repeated View views = 2;
|
|
}
|
|
|
|
message UpdateFollowers {
|
|
uint64 project_id = 1;
|
|
repeated uint32 follower_ids = 2;
|
|
oneof variant {
|
|
UpdateActiveView update_active_view = 3;
|
|
View create_view = 4;
|
|
UpdateView update_view = 5;
|
|
}
|
|
}
|
|
|
|
message Unfollow {
|
|
uint64 project_id = 1;
|
|
uint32 leader_id = 2;
|
|
}
|
|
|
|
// Entities
|
|
|
|
message UpdateActiveView {
|
|
optional uint64 id = 1;
|
|
optional uint32 leader_id = 2;
|
|
}
|
|
|
|
message UpdateView {
|
|
uint64 id = 1;
|
|
optional uint32 leader_id = 2;
|
|
|
|
oneof variant {
|
|
Editor editor = 3;
|
|
}
|
|
|
|
message Editor {
|
|
repeated Selection selections = 1;
|
|
Anchor scroll_top_anchor = 2;
|
|
float scroll_x = 3;
|
|
float scroll_y = 4;
|
|
}
|
|
}
|
|
|
|
message View {
|
|
uint64 id = 1;
|
|
optional uint32 leader_id = 2;
|
|
|
|
oneof variant {
|
|
Editor editor = 3;
|
|
}
|
|
|
|
message Editor {
|
|
uint64 buffer_id = 1;
|
|
repeated Selection selections = 2;
|
|
Anchor scroll_top_anchor = 3;
|
|
float scroll_x = 4;
|
|
float scroll_y = 5;
|
|
}
|
|
}
|
|
|
|
message Collaborator {
|
|
uint32 peer_id = 1;
|
|
uint32 replica_id = 2;
|
|
uint64 user_id = 3;
|
|
}
|
|
|
|
message User {
|
|
uint64 id = 1;
|
|
string github_login = 2;
|
|
string avatar_url = 3;
|
|
}
|
|
|
|
message File {
|
|
uint64 worktree_id = 1;
|
|
optional uint64 entry_id = 2;
|
|
string path = 3;
|
|
Timestamp mtime = 4;
|
|
}
|
|
|
|
message Entry {
|
|
uint64 id = 1;
|
|
bool is_dir = 2;
|
|
bytes path = 3;
|
|
uint64 inode = 4;
|
|
Timestamp mtime = 5;
|
|
bool is_symlink = 6;
|
|
bool is_ignored = 7;
|
|
}
|
|
|
|
message Buffer {
|
|
uint64 id = 1;
|
|
optional File file = 2;
|
|
string base_text = 3;
|
|
repeated Operation operations = 4;
|
|
repeated SelectionSet selections = 5;
|
|
repeated Diagnostic diagnostics = 6;
|
|
uint32 diagnostics_timestamp = 7;
|
|
repeated string completion_triggers = 8;
|
|
LineEnding line_ending = 9;
|
|
}
|
|
|
|
enum LineEnding {
|
|
Unix = 0;
|
|
Windows = 1;
|
|
}
|
|
|
|
message SelectionSet {
|
|
uint32 replica_id = 1;
|
|
repeated Selection selections = 2;
|
|
uint32 lamport_timestamp = 3;
|
|
bool line_mode = 4;
|
|
}
|
|
|
|
message Selection {
|
|
uint64 id = 1;
|
|
Anchor start = 2;
|
|
Anchor end = 3;
|
|
bool reversed = 4;
|
|
}
|
|
|
|
message Anchor {
|
|
uint32 replica_id = 1;
|
|
uint32 local_timestamp = 2;
|
|
uint64 offset = 3;
|
|
Bias bias = 4;
|
|
optional uint64 buffer_id = 5;
|
|
}
|
|
|
|
enum Bias {
|
|
Left = 0;
|
|
Right = 1;
|
|
}
|
|
|
|
message Diagnostic {
|
|
Anchor start = 1;
|
|
Anchor end = 2;
|
|
Severity severity = 3;
|
|
string message = 4;
|
|
optional string code = 5;
|
|
uint64 group_id = 6;
|
|
bool is_primary = 7;
|
|
bool is_valid = 8;
|
|
bool is_disk_based = 9;
|
|
bool is_unnecessary = 10;
|
|
|
|
enum Severity {
|
|
None = 0;
|
|
Error = 1;
|
|
Warning = 2;
|
|
Information = 3;
|
|
Hint = 4;
|
|
}
|
|
}
|
|
|
|
message Operation {
|
|
oneof variant {
|
|
Edit edit = 1;
|
|
Undo undo = 2;
|
|
UpdateSelections update_selections = 3;
|
|
UpdateDiagnostics update_diagnostics = 4;
|
|
UpdateCompletionTriggers update_completion_triggers = 5;
|
|
}
|
|
|
|
message Edit {
|
|
uint32 replica_id = 1;
|
|
uint32 local_timestamp = 2;
|
|
uint32 lamport_timestamp = 3;
|
|
repeated VectorClockEntry version = 4;
|
|
repeated Range ranges = 5;
|
|
repeated string new_text = 6;
|
|
}
|
|
|
|
message Undo {
|
|
uint32 replica_id = 1;
|
|
uint32 local_timestamp = 2;
|
|
uint32 lamport_timestamp = 3;
|
|
repeated VectorClockEntry version = 4;
|
|
repeated UndoCount counts = 5;
|
|
}
|
|
|
|
message UpdateSelections {
|
|
uint32 replica_id = 1;
|
|
uint32 lamport_timestamp = 2;
|
|
repeated Selection selections = 3;
|
|
bool line_mode = 4;
|
|
}
|
|
|
|
message UpdateCompletionTriggers {
|
|
uint32 replica_id = 1;
|
|
uint32 lamport_timestamp = 2;
|
|
repeated string triggers = 3;
|
|
}
|
|
}
|
|
|
|
message UndoMapEntry {
|
|
uint32 replica_id = 1;
|
|
uint32 local_timestamp = 2;
|
|
repeated UndoCount counts = 3;
|
|
}
|
|
|
|
message UndoCount {
|
|
uint32 replica_id = 1;
|
|
uint32 local_timestamp = 2;
|
|
uint32 count = 3;
|
|
}
|
|
|
|
message VectorClockEntry {
|
|
uint32 replica_id = 1;
|
|
uint32 timestamp = 2;
|
|
}
|
|
|
|
message Timestamp {
|
|
uint64 seconds = 1;
|
|
uint32 nanos = 2;
|
|
}
|
|
|
|
message Range {
|
|
uint64 start = 1;
|
|
uint64 end = 2;
|
|
}
|
|
|
|
message Point {
|
|
uint32 row = 1;
|
|
uint32 column = 2;
|
|
}
|
|
|
|
message Nonce {
|
|
uint64 upper_half = 1;
|
|
uint64 lower_half = 2;
|
|
}
|
|
|
|
message Channel {
|
|
uint64 id = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
message ChannelMessage {
|
|
uint64 id = 1;
|
|
string body = 2;
|
|
uint64 timestamp = 3;
|
|
uint64 sender_id = 4;
|
|
Nonce nonce = 5;
|
|
}
|
|
|
|
message Contact {
|
|
uint64 user_id = 1;
|
|
repeated ProjectMetadata projects = 2;
|
|
bool online = 3;
|
|
bool should_notify = 4;
|
|
}
|
|
|
|
message ProjectMetadata {
|
|
uint64 id = 1;
|
|
repeated string visible_worktree_root_names = 3;
|
|
repeated uint64 guests = 4;
|
|
}
|
|
|
|
message WorktreeMetadata {
|
|
uint64 id = 1;
|
|
string root_name = 2;
|
|
bool visible = 3;
|
|
}
|