Serialize buffer in terms of operations rather than state

This is required because, after joining, we want to be able to refer
to operations that have happened prior to joining, which are not
captured by the state. There is probably a way of reconstructing operations
from the state, but that seems unnecessary and we've already talked about
wanting to have the server store operations rather than state once we start
persisting worktrees.
This commit is contained in:
Antonio Scandurra
2022-02-08 14:59:46 +01:00
parent dca974c7d4
commit 624eb5907e
6 changed files with 146 additions and 170 deletions
+8 -11
View File
@@ -406,16 +406,11 @@ message Buffer {
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;
string base_text = 3;
repeated Operation operations = 4;
repeated SelectionSet selections = 5;
repeated Diagnostic diagnostics = 6;
repeated string completion_triggers = 7;
}
message BufferFragment {
@@ -514,7 +509,9 @@ message Operation {
}
message UpdateCompletionTriggers {
repeated string triggers = 1;
uint32 replica_id = 1;
uint32 lamport_timestamp = 2;
repeated string triggers = 3;
}
}