Move protobuf logic from buffer crate to language crate

This will enable us to add operations that only pertain to the language crate.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2021-11-01 14:05:19 -07:00
parent 78d97a3db2
commit 40c861c249
7 changed files with 322 additions and 338 deletions

View file

@ -430,8 +430,8 @@ impl Worktree {
let ops = payload
.operations
.into_iter()
.map(|op| op.try_into())
.collect::<anyhow::Result<Vec<_>>>()?;
.map(|op| language::proto::deserialize_operation(op))
.collect::<Result<Vec<_>, _>>()?;
match self {
Worktree::Local(worktree) => {
@ -1944,7 +1944,7 @@ impl language::File for File {
.request(proto::UpdateBuffer {
worktree_id: remote_id,
buffer_id,
operations: vec![(&operation).into()],
operations: vec![language::proto::serialize_operation(&operation)],
})
.await
{