mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-10 14:06:11 +03:00
577 lines
12 KiB
Protocol Buffer
577 lines
12 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;
|
|
|
|
RegisterProject register_project = 7;
|
|
RegisterProjectResponse register_project_response = 8;
|
|
UnregisterProject unregister_project = 9;
|
|
ShareProject share_project = 10;
|
|
UnshareProject unshare_project = 11;
|
|
JoinProject join_project = 12;
|
|
JoinProjectResponse join_project_response = 13;
|
|
LeaveProject leave_project = 14;
|
|
AddProjectCollaborator add_project_collaborator = 15;
|
|
RemoveProjectCollaborator remove_project_collaborator = 16;
|
|
GetDefinition get_definition = 17;
|
|
GetDefinitionResponse get_definition_response = 18;
|
|
|
|
RegisterWorktree register_worktree = 19;
|
|
UnregisterWorktree unregister_worktree = 20;
|
|
ShareWorktree share_worktree = 21;
|
|
UpdateWorktree update_worktree = 22;
|
|
UpdateDiagnosticSummary update_diagnostic_summary = 23;
|
|
DiskBasedDiagnosticsUpdating disk_based_diagnostics_updating = 24;
|
|
DiskBasedDiagnosticsUpdated disk_based_diagnostics_updated = 25;
|
|
|
|
OpenBuffer open_buffer = 26;
|
|
OpenBufferResponse open_buffer_response = 27;
|
|
CloseBuffer close_buffer = 28;
|
|
UpdateBuffer update_buffer = 29;
|
|
UpdateBufferFile update_buffer_file = 30;
|
|
SaveBuffer save_buffer = 31;
|
|
BufferSaved buffer_saved = 32;
|
|
BufferReloaded buffer_reloaded = 33;
|
|
FormatBuffer format_buffer = 34;
|
|
GetCompletions get_completions = 35;
|
|
GetCompletionsResponse get_completions_response = 36;
|
|
ApplyCompletionAdditionalEdits apply_completion_additional_edits = 37;
|
|
ApplyCompletionAdditionalEditsResponse apply_completion_additional_edits_response = 38;
|
|
GetCodeActions get_code_actions = 39;
|
|
GetCodeActionsResponse get_code_actions_response = 40;
|
|
ApplyCodeAction apply_code_action = 41;
|
|
ApplyCodeActionResponse apply_code_action_response = 42;
|
|
|
|
GetChannels get_channels = 43;
|
|
GetChannelsResponse get_channels_response = 44;
|
|
JoinChannel join_channel = 45;
|
|
JoinChannelResponse join_channel_response = 46;
|
|
LeaveChannel leave_channel = 47;
|
|
SendChannelMessage send_channel_message = 48;
|
|
SendChannelMessageResponse send_channel_message_response = 49;
|
|
ChannelMessageSent channel_message_sent = 50;
|
|
GetChannelMessages get_channel_messages = 51;
|
|
GetChannelMessagesResponse get_channel_messages_response = 52;
|
|
|
|
UpdateContacts update_contacts = 53;
|
|
|
|
GetUsers get_users = 54;
|
|
GetUsersResponse get_users_response = 55;
|
|
}
|
|
}
|
|
|
|
// Messages
|
|
|
|
message Ping {}
|
|
|
|
message Ack {}
|
|
|
|
message Error {
|
|
string message = 1;
|
|
}
|
|
|
|
message RegisterProject {}
|
|
|
|
message RegisterProjectResponse {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message UnregisterProject {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message ShareProject {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message UnshareProject {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message JoinProject {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message JoinProjectResponse {
|
|
uint32 replica_id = 1;
|
|
repeated Worktree worktrees = 2;
|
|
repeated Collaborator collaborators = 3;
|
|
}
|
|
|
|
message LeaveProject {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message RegisterWorktree {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
string root_name = 3;
|
|
repeated string authorized_logins = 4;
|
|
}
|
|
|
|
message UnregisterWorktree {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
}
|
|
|
|
message ShareWorktree {
|
|
uint64 project_id = 1;
|
|
Worktree worktree = 2;
|
|
}
|
|
|
|
message UpdateWorktree {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
string root_name = 3;
|
|
repeated Entry updated_entries = 4;
|
|
repeated uint64 removed_entries = 5;
|
|
}
|
|
|
|
message AddProjectCollaborator {
|
|
uint64 project_id = 1;
|
|
Collaborator collaborator = 2;
|
|
}
|
|
|
|
message RemoveProjectCollaborator {
|
|
uint64 project_id = 1;
|
|
uint32 peer_id = 2;
|
|
}
|
|
|
|
message GetDefinition {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
}
|
|
|
|
message GetDefinitionResponse {
|
|
repeated Definition definitions = 1;
|
|
}
|
|
|
|
message Definition {
|
|
Buffer buffer = 1;
|
|
Anchor target_start = 2;
|
|
Anchor target_end = 3;
|
|
}
|
|
|
|
message OpenBuffer {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
string path = 3;
|
|
}
|
|
|
|
message OpenBufferResponse {
|
|
Buffer buffer = 1;
|
|
}
|
|
|
|
message CloseBuffer {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
message BufferSaved {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
repeated VectorClockEntry version = 3;
|
|
Timestamp mtime = 4;
|
|
}
|
|
|
|
message BufferReloaded {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
repeated VectorClockEntry version = 3;
|
|
Timestamp mtime = 4;
|
|
}
|
|
|
|
message FormatBuffer {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
}
|
|
|
|
message GetCompletions {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Anchor position = 3;
|
|
}
|
|
|
|
message GetCompletionsResponse {
|
|
repeated Completion completions = 1;
|
|
}
|
|
|
|
message ApplyCompletionAdditionalEdits {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
Completion completion = 3;
|
|
}
|
|
|
|
message ApplyCompletionAdditionalEditsResponse {
|
|
repeated EditId additional_edits = 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 position = 3;
|
|
}
|
|
|
|
message GetCodeActionsResponse {
|
|
repeated CodeAction actions = 1;
|
|
}
|
|
|
|
message ApplyCodeAction {
|
|
uint64 project_id = 1;
|
|
uint64 buffer_id = 2;
|
|
CodeAction action = 3;
|
|
}
|
|
|
|
message ApplyCodeActionResponse {
|
|
repeated CodeActionBufferEdits buffer_edits = 1;
|
|
}
|
|
|
|
message CodeAction {
|
|
Anchor position = 1;
|
|
bytes lsp_action = 2;
|
|
}
|
|
|
|
message CodeActionBufferEdits {
|
|
Buffer buffer = 1;
|
|
repeated CodeActionEdit edits = 2;
|
|
}
|
|
|
|
message CodeActionEdit {
|
|
EditId id = 1;
|
|
Anchor old_start = 2;
|
|
Anchor old_end = 3;
|
|
}
|
|
|
|
message EditId {
|
|
uint32 replica_id = 1;
|
|
uint32 local_timestamp = 2;
|
|
}
|
|
|
|
message UpdateDiagnosticSummary {
|
|
uint64 project_id = 1;
|
|
uint64 worktree_id = 2;
|
|
DiagnosticSummary summary = 3;
|
|
}
|
|
|
|
message DiagnosticSummary {
|
|
string path = 1;
|
|
uint32 error_count = 2;
|
|
uint32 warning_count = 3;
|
|
uint32 info_count = 4;
|
|
uint32 hint_count = 5;
|
|
}
|
|
|
|
message DiskBasedDiagnosticsUpdating {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
message DiskBasedDiagnosticsUpdated {
|
|
uint64 project_id = 1;
|
|
}
|
|
|
|
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 GetUsersResponse {
|
|
repeated User users = 1;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
// Entities
|
|
|
|
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 Worktree {
|
|
uint64 id = 1;
|
|
string root_name = 2;
|
|
repeated Entry entries = 3;
|
|
repeated DiagnosticSummary diagnostic_summaries = 4;
|
|
bool weak = 5;
|
|
}
|
|
|
|
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;
|
|
string path = 3;
|
|
uint64 inode = 4;
|
|
Timestamp mtime = 5;
|
|
bool is_symlink = 6;
|
|
bool is_ignored = 7;
|
|
}
|
|
|
|
message Buffer {
|
|
oneof variant {
|
|
uint64 id = 1;
|
|
BufferState state = 2;
|
|
}
|
|
}
|
|
|
|
message BufferState {
|
|
uint64 id = 1;
|
|
optional File file = 2;
|
|
string visible_text = 3;
|
|
string deleted_text = 4;
|
|
repeated BufferFragment fragments = 5;
|
|
repeated UndoMapEntry undo_map = 6;
|
|
repeated VectorClockEntry version = 7;
|
|
repeated SelectionSet selections = 8;
|
|
repeated Diagnostic diagnostics = 9;
|
|
uint32 lamport_timestamp = 10;
|
|
repeated Operation deferred_operations = 11;
|
|
repeated string completion_triggers = 12;
|
|
}
|
|
|
|
message BufferFragment {
|
|
uint32 replica_id = 1;
|
|
uint32 local_timestamp = 2;
|
|
uint32 lamport_timestamp = 3;
|
|
uint32 insertion_offset = 4;
|
|
uint32 len = 5;
|
|
bool visible = 6;
|
|
repeated VectorClockEntry deletions = 7;
|
|
repeated VectorClockEntry max_undos = 8;
|
|
}
|
|
|
|
message SelectionSet {
|
|
uint32 replica_id = 1;
|
|
repeated Selection selections = 2;
|
|
uint32 lamport_timestamp = 3;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
enum Bias {
|
|
Left = 0;
|
|
Right = 1;
|
|
}
|
|
|
|
message UpdateDiagnostics {
|
|
uint32 replica_id = 1;
|
|
uint32 lamport_timestamp = 2;
|
|
repeated Diagnostic diagnostics = 3;
|
|
}
|
|
|
|
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;
|
|
|
|
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;
|
|
optional string new_text = 6;
|
|
}
|
|
|
|
message Undo {
|
|
uint32 replica_id = 1;
|
|
uint32 local_timestamp = 2;
|
|
uint32 lamport_timestamp = 3;
|
|
repeated Range ranges = 4;
|
|
repeated VectorClockEntry version = 5;
|
|
repeated UndoCount counts = 6;
|
|
}
|
|
|
|
message UpdateSelections {
|
|
uint32 replica_id = 1;
|
|
uint32 lamport_timestamp = 2;
|
|
repeated Selection selections = 3;
|
|
}
|
|
|
|
message UpdateCompletionTriggers {
|
|
repeated string triggers = 1;
|
|
}
|
|
}
|
|
|
|
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 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;
|
|
}
|
|
|
|
message ProjectMetadata {
|
|
uint64 id = 1;
|
|
bool is_shared = 2;
|
|
repeated string worktree_root_names = 3;
|
|
repeated uint64 guests = 4;
|
|
}
|