mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-19 02:17:35 +03:00
Deserialize buffer's diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
2c57703ad6
commit
1995bd89a6
@ -256,6 +256,7 @@ impl Buffer {
|
||||
replica_id: ReplicaId,
|
||||
message: proto::Buffer,
|
||||
file: Option<Box<dyn File>>,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Result<Self> {
|
||||
let mut buffer =
|
||||
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);
|
||||
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 {
|
||||
@ -1351,6 +1356,7 @@ impl Buffer {
|
||||
cx: &mut ModelContext<Self>,
|
||||
) {
|
||||
self.diagnostics = diagnostics;
|
||||
self.diagnostics_update_count += 1;
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
|
@ -1391,7 +1391,7 @@ impl RemoteWorktree {
|
||||
let remote_buffer = response.buffer.ok_or_else(|| anyhow!("empty buffer"))?;
|
||||
let buffer_id = remote_buffer.id as usize;
|
||||
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()
|
||||
.with_language(language, None, cx)
|
||||
});
|
||||
|
@ -5,7 +5,7 @@ set -e
|
||||
# Install sqlx-cli if needed
|
||||
[[ "$(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
|
||||
eval "$(cargo run --bin dotenv)"
|
||||
|
Loading…
Reference in New Issue
Block a user