Deserialize buffer's diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
2c57703ad6
commit
1995bd89a6
3 changed files with 9 additions and 3 deletions
|
@ -256,6 +256,7 @@ impl Buffer {
|
||||||
replica_id: ReplicaId,
|
replica_id: ReplicaId,
|
||||||
message: proto::Buffer,
|
message: proto::Buffer,
|
||||||
file: Option<Box<dyn File>>,
|
file: Option<Box<dyn File>>,
|
||||||
|
cx: &mut ModelContext<Self>,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
let mut buffer =
|
let mut buffer =
|
||||||
buffer::Buffer::new(replica_id, message.id, History::new(message.content.into()));
|
buffer::Buffer::new(replica_id, message.id, History::new(message.content.into()));
|
||||||
|
@ -268,7 +269,11 @@ impl Buffer {
|
||||||
let set = proto::deserialize_selection_set(set);
|
let set = proto::deserialize_selection_set(set);
|
||||||
buffer.add_raw_selection_set(set.id, set);
|
buffer.add_raw_selection_set(set.id, set);
|
||||||
}
|
}
|
||||||
Ok(Self::build(buffer, file))
|
let mut this = Self::build(buffer, file);
|
||||||
|
if let Some(diagnostics) = message.diagnostics {
|
||||||
|
this.apply_diagnostic_update(proto::deserialize_diagnostics(diagnostics), cx);
|
||||||
|
}
|
||||||
|
Ok(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_proto(&self) -> proto::Buffer {
|
pub fn to_proto(&self) -> proto::Buffer {
|
||||||
|
@ -1351,6 +1356,7 @@ impl Buffer {
|
||||||
cx: &mut ModelContext<Self>,
|
cx: &mut ModelContext<Self>,
|
||||||
) {
|
) {
|
||||||
self.diagnostics = diagnostics;
|
self.diagnostics = diagnostics;
|
||||||
|
self.diagnostics_update_count += 1;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1391,7 +1391,7 @@ impl RemoteWorktree {
|
||||||
let remote_buffer = response.buffer.ok_or_else(|| anyhow!("empty buffer"))?;
|
let remote_buffer = response.buffer.ok_or_else(|| anyhow!("empty buffer"))?;
|
||||||
let buffer_id = remote_buffer.id as usize;
|
let buffer_id = remote_buffer.id as usize;
|
||||||
let buffer = cx.add_model(|cx| {
|
let buffer = cx.add_model(|cx| {
|
||||||
Buffer::from_proto(replica_id, remote_buffer, Some(Box::new(file)))
|
Buffer::from_proto(replica_id, remote_buffer, Some(Box::new(file)), cx)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.with_language(language, None, cx)
|
.with_language(language, None, cx)
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,7 @@ set -e
|
||||||
# Install sqlx-cli if needed
|
# Install sqlx-cli if needed
|
||||||
[[ "$(sqlx --version)" == "sqlx-cli 0.5.7" ]] || cargo install sqlx-cli --version 0.5.7
|
[[ "$(sqlx --version)" == "sqlx-cli 0.5.7" ]] || cargo install sqlx-cli --version 0.5.7
|
||||||
|
|
||||||
cd server
|
cd crates/server
|
||||||
|
|
||||||
# Export contents of .env.toml
|
# Export contents of .env.toml
|
||||||
eval "$(cargo run --bin dotenv)"
|
eval "$(cargo run --bin dotenv)"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue