Bump dependencies to dedupe the crate graph (#63231)
Deduplicates crates with different versions from the graph, drops unused features. `cargo tree -d duplicate` listing: 160 -> 112 lines. <details> <summary>Deduplicated list</summary> ``` base64 (v0.22.1, v0.21.7 -> v0.22.1) convert_case (v0.11.0, v0.10.0, v0.8.0 -> v0.11.0, v0.10.0) core-foundation (v0.10.0, v0.9.4 -> v0.10.0) cssparser (v0.36.0, v0.35.0 -> v0.37.0, v0.36.0) fancy-regex (v0.18.0, v0.16.2 -> v0.19.0) fixedbitset (v0.5.7, v0.4.2 -> v0.5.7) h2 (v0.4.12, v0.3.27 -> v0.4.12) heck (v0.5.0, v0.4.1, v0.3.3 -> v0.5.0, v0.4.1) html5ever (v0.39.0, v0.35.0 -> v0.39.0) hyper (v1.7.0, v0.14.32 -> v1.7.0) hyper-rustls (v0.27.9, v0.24.2 -> v0.27.9) mach2 (v0.6.0, v0.5.0, v0.4.3 -> v0.6.0, v0.5.0) markup5ever (v0.39.0, v0.35.0 -> v0.39.0) phf (v0.13.1, v0.12.1, v0.11.3 -> v0.13.1, v0.11.3) phf_codegen (v0.13.1, v0.11.3 -> v0.13.1) phf_generator (v0.13.1, v0.12.1, v0.11.3 -> v0.13.1, v0.11.3) phf_macros (v0.13.1, v0.12.1, v0.11.3 -> v0.13.1, v0.11.3) phf_shared (v0.13.1, v0.12.1, v0.11.3 -> v0.13.1, v0.11.3) prost (v0.12.6, v0.9.0 -> v0.14.4) prost-build (v0.12.6, v0.9.0 -> v0.14.4) prost-derive (v0.12.6, v0.9.0 -> v0.14.4) prost-types (v0.12.6, v0.9.0 -> v0.14.4) rustix (v1.1.4, v0.38.44 -> v1.1.4) rustls (v0.23.40, v0.21.12 -> v0.23.40) rustls-native-certs (v0.8.3, v0.6.3 -> v0.8.3) rustls-pemfile (v2.2.0, v1.0.4 -> v2.2.0) rustls-webpki (v0.103.13, v0.101.7 -> v0.103.13) security-framework (v3.5.1, v2.11.1 -> v3.5.1) socket2 (v0.6.3, v0.5.10 -> v0.6.3) string_cache (v0.9.0, v0.8.9 -> v0.9.0) string_cache_codegen (v0.6.1, v0.5.4 -> v0.6.1) strum (v0.28.0, v0.27.2 -> v0.28.0) strum_macros (v0.28.0, v0.27.2 -> v0.28.0) tendril (v0.5.1, v0.4.3 -> v0.5.1) tokio-rustls (v0.26.4, v0.24.1 -> v0.26.4) tungstenite (v0.28.0, v0.27.0 -> v0.28.0) web_atoms (v0.2.6, v0.1.3 -> v0.2.6) which (v6.0.3, v4.4.2 -> v8.0.5) ``` </details> Release Notes: - N/A
This commit is contained in:
1 parent
677e8174b5
commit
f36284a155
34 files changed
+656
-703
No files matched your search
Generated
+520
-581
File diff suppressed because it is too large.
Load diff
+25
-21
@@ -542,14 +542,16 @@ async-std = { version = "1.12", features = ["unstable"] }
|
||||
async-tar = { git = "https://github.com/zed-industries/async-tar", rev = "bd3ad6f89df9a9da7a8535958756d6bf465936a0" }
|
||||
async-task = "4.7"
|
||||
async-trait = "0.1"
|
||||
async-tungstenite = "0.31.0"
|
||||
async-tungstenite = "0.33"
|
||||
async_zip = { version = "0.0.18", features = ["deflate", "deflate64"] }
|
||||
aws-config = { version = "1.8.10", features = ["behavior-version-latest"] }
|
||||
aws-credential-types = { version = "1.2.8", features = [
|
||||
"hardcoded-credentials",
|
||||
] }
|
||||
aws-sdk-bedrockruntime = { version = "1.112.0", features = [
|
||||
aws-sdk-bedrockruntime = { version = "1.112.0", default-features = false, features = [
|
||||
"behavior-version-latest",
|
||||
"default-https-client",
|
||||
"rt-tokio",
|
||||
] }
|
||||
aws-sigv4 = { version = "1.4.0", features = ["http1"] }
|
||||
aws-smithy-runtime-api = { version = "1.9.2", features = ["http-1x", "client"] }
|
||||
@@ -582,7 +584,7 @@ core-graphics = "0.24"
|
||||
core-text = "21"
|
||||
core-video = { version = "0.5.2", features = ["metal"] }
|
||||
cpal = "0.17"
|
||||
crash-handler = "0.7"
|
||||
crash-handler = "0.8"
|
||||
criterion = { version = "0.5", features = ["html_reports"] }
|
||||
crossbeam = "0.8.4"
|
||||
ctor = "1.0.12"
|
||||
@@ -602,16 +604,16 @@ derive_more = { version = "2.1.1", features = [
|
||||
] }
|
||||
dialoguer = { version = "0.12", default-features = false }
|
||||
dirs = "6.0"
|
||||
documented = "0.9.1"
|
||||
documented = "0.10"
|
||||
dotenvy = "0.15.0"
|
||||
dunce = "1.0"
|
||||
ec4rs = { version = "1.2", features = ["allow-empty-values"] }
|
||||
emojis = "0.6.1"
|
||||
emojis = "0.9"
|
||||
encoding_rs = "0.8"
|
||||
env_logger = "0.11"
|
||||
etagere = "0.2"
|
||||
exec = "0.3.1"
|
||||
fancy-regex = "0.18.0"
|
||||
fancy-regex = "0.19"
|
||||
flume = "0.12"
|
||||
foreign-types = "0.5"
|
||||
fork = "0.4.0"
|
||||
@@ -621,12 +623,12 @@ futures-lite = "1.13"
|
||||
gh-workflow = { git = "https://github.com/zed-industries/gh-workflow", rev = "37f3c0575d379c218a9c455ee67585184e40d43f" }
|
||||
globset = "0.4"
|
||||
handlebars = "4.3"
|
||||
hdrhistogram = "7"
|
||||
hdrhistogram = { version = "7", default-features = false }
|
||||
heapless = "0.9.2"
|
||||
heck = "0.5"
|
||||
heed = { version = "0.21.0", features = ["read-txn-no-tls"] }
|
||||
hex = "0.4.3"
|
||||
html5ever = "0.27.0"
|
||||
html5ever = "0.39"
|
||||
http = "1.1"
|
||||
http-body = "1.0"
|
||||
httparse = "1.10"
|
||||
@@ -659,7 +661,7 @@ inventory = "0.3.19"
|
||||
itertools = "0.14.0"
|
||||
js-sys = "0.3"
|
||||
json_dotpath = "1.1"
|
||||
jsonschema = "0.37.0"
|
||||
jsonschema = { version = "0.51", default-features = false }
|
||||
jsonwebtoken = "10.0"
|
||||
jupyter-protocol = "1.4.0"
|
||||
jupyter-websocket-client = "1.1.0"
|
||||
@@ -672,10 +674,10 @@ log = { version = "0.4.16", features = ["kv_unstable_serde", "serde"] }
|
||||
lru = "0.16"
|
||||
lsp-types = { git = "https://github.com/zed-industries/lsp-types", rev = "f4dfa89a21ca35cd929b70354b1583fabae325f8" }
|
||||
mach2 = "0.5"
|
||||
markup5ever_rcdom = "0.3.0"
|
||||
markup5ever_rcdom = "0.39"
|
||||
metal = "0.33"
|
||||
mime = "0.3.17"
|
||||
minidumper = "0.9"
|
||||
minidumper = "0.11"
|
||||
moka = { version = "0.12.10", features = ["sync"] }
|
||||
nanoid = "0.4"
|
||||
nbformat = "1.2.0"
|
||||
@@ -747,9 +749,10 @@ profiling = "1"
|
||||
pollster = "0.4.0"
|
||||
proptest = { git = "https://github.com/proptest-rs/proptest", rev = "3dca198a8fef1b32e3a66f1e1897c955b4dc5b5b", features = ["attr-macro"] }
|
||||
proptest-derive = "0.8.0"
|
||||
prost = "0.9"
|
||||
prost-build = "0.9"
|
||||
prost-types = "0.9"
|
||||
prost = "0.14"
|
||||
prost-build = "0.14"
|
||||
prost-types = "0.14"
|
||||
protox = "0.9"
|
||||
proxyvars = "0.2"
|
||||
pulldown-cmark = { version = "0.13.0", default-features = false }
|
||||
quick-xml = "0.38"
|
||||
@@ -759,7 +762,7 @@ raw-window-handle = "0.6"
|
||||
rayon = "1.8"
|
||||
regex = "1.5"
|
||||
# WARNING: If you change this, you must also publish a new version of zed-reqwest to crates.io
|
||||
reqwest = { git = "https://github.com/zed-industries/reqwest.git", rev = "c15662463bda39148ba154100dd44d3fba5873a4", default-features = false, features = [
|
||||
reqwest = { git = "https://github.com/zed-industries/reqwest.git", rev = "33bc764aa15ff7b200bf7c93bd96e24878d53e14", default-features = false, features = [
|
||||
"charset",
|
||||
"http2",
|
||||
"macos-system-configuration",
|
||||
@@ -782,7 +785,7 @@ rust-embed = { version = "8.11", features = ["include-exclude"] }
|
||||
rustc-hash = "2.1.0"
|
||||
rustix = { version = "1.1", features = ["fs"] }
|
||||
rustls = { version = "0.23.26" }
|
||||
rustls-platform-verifier = "0.5.0"
|
||||
rustls-platform-verifier = "0.7"
|
||||
# WARNING: If you change this, you must also publish a new version of zed-scap to crates.io
|
||||
scap = { git = "https://github.com/zed-industries/scap", rev = "4afea48c3b002197176fb19cd0f9b180dd36eaac", default-features = false, package = "zed-scap", version = "0.0.8-zed" }
|
||||
schemars = { version = "1.0", features = ["indexmap2"] }
|
||||
@@ -809,7 +812,7 @@ sqlformat = "0.2"
|
||||
stacksafe = "1.0"
|
||||
streaming-iterator = "0.1"
|
||||
strsim = "0.11"
|
||||
strum = { version = "0.27.2", features = ["derive"] }
|
||||
strum = { version = "0.28", features = ["derive"] }
|
||||
swash = "0.2.6"
|
||||
syn = { version = "2.0.101", features = ["full", "extra-traits", "visit-mut"] }
|
||||
sys-locale = "0.3.1"
|
||||
@@ -889,9 +892,10 @@ wasm-bindgen-futures = "0.4"
|
||||
wasmtime-wasi = "48"
|
||||
wax = "0.7"
|
||||
web-time = "1.1.0"
|
||||
webpki-roots = "1.0.8"
|
||||
webrtc-sys = "0.3.23"
|
||||
wgpu = "29.0.4"
|
||||
which = "6.0.0"
|
||||
which = "8"
|
||||
windows-core = "0.61"
|
||||
windows-registry = "0.6.0"
|
||||
yaml-rust2 = "0.8"
|
||||
@@ -970,11 +974,11 @@ async-process = { git = "https://github.com/zed-industries/async-process.git", r
|
||||
async-task = { git = "https://github.com/smol-rs/async-task.git", rev = "b4486cd71e4e94fbda54ce6302444de14f4d190e" }
|
||||
windows-capture = { git = "https://github.com/zed-industries/windows-capture.git", rev = "f0d6c1b6691db75461b732f6d5ff56eed002eeb9" }
|
||||
calloop = { git = "https://github.com/zed-industries/calloop" }
|
||||
livekit = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "d0e27be0cdad89eadab3e36207cda0a2b6e359ee" }
|
||||
libwebrtc = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "d0e27be0cdad89eadab3e36207cda0a2b6e359ee" }
|
||||
livekit = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "0a1c519cfce9b365229026b55de9b9dbdb6fed3c" }
|
||||
libwebrtc = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "0a1c519cfce9b365229026b55de9b9dbdb6fed3c" }
|
||||
notify = { git = "https://github.com/zed-industries/notify", rev = "0890bbb8ca40a4b5d1f67031698dd7918b37d991" }
|
||||
notify-types = { git = "https://github.com/zed-industries/notify", rev = "0890bbb8ca40a4b5d1f67031698dd7918b37d991" }
|
||||
webrtc-sys = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "d0e27be0cdad89eadab3e36207cda0a2b6e359ee" }
|
||||
webrtc-sys = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "0a1c519cfce9b365229026b55de9b9dbdb6fed3c" }
|
||||
|
||||
[profile.dev]
|
||||
split-debuginfo = "unpacked"
|
||||
|
||||
@@ -147,7 +147,7 @@ impl ActivityIndicator {
|
||||
let status = match &status_update.status {
|
||||
Some(proto::status_update::Status::Binary(binary_status)) => {
|
||||
if let Some(binary_status) =
|
||||
proto::ServerBinaryStatus::from_i32(*binary_status)
|
||||
proto::ServerBinaryStatus::try_from(*binary_status).ok()
|
||||
{
|
||||
let binary_status = match binary_status {
|
||||
proto::ServerBinaryStatus::None => BinaryStatus::None,
|
||||
@@ -181,7 +181,7 @@ impl ActivityIndicator {
|
||||
}
|
||||
Some(proto::status_update::Status::Health(health_status)) => {
|
||||
if let Some(health) =
|
||||
proto::ServerHealth::from_i32(*health_status)
|
||||
proto::ServerHealth::try_from(*health_status).ok()
|
||||
{
|
||||
let health = match health {
|
||||
proto::ServerHealth::Ok => ServerHealth::Ok,
|
||||
|
||||
@@ -863,7 +863,7 @@ impl ChannelStore {
|
||||
);
|
||||
}
|
||||
for membership in message.payload.channel_memberships {
|
||||
if let Some(role) = ChannelRole::from_i32(membership.role) {
|
||||
if let Some(role) = ChannelRole::try_from(membership.role).ok() {
|
||||
this.channel_states
|
||||
.entry(ChannelId(membership.channel_id))
|
||||
.or_default()
|
||||
|
||||
@@ -49,7 +49,7 @@ fork.workspace = true
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
core-foundation.workspace = true
|
||||
core-services = "0.2"
|
||||
core-services = "1"
|
||||
plist = "1.3"
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
|
||||
@@ -746,7 +746,6 @@ fn proto_status_to_db(
|
||||
|
||||
let (status_kind, first_status, second_status) = status_entry
|
||||
.status
|
||||
.clone()
|
||||
.and_then(|status| status.variant)
|
||||
.map_or(
|
||||
(StatusKind::Untracked, None, None),
|
||||
|
||||
@@ -276,7 +276,7 @@ impl Database {
|
||||
|
||||
if !update.updated_entries.is_empty() {
|
||||
worktree_entry::Entity::insert_many(update.updated_entries.iter().map(|entry| {
|
||||
let mtime = entry.mtime.clone().unwrap_or_default();
|
||||
let mtime = entry.mtime.unwrap_or_default();
|
||||
worktree_entry::ActiveModel {
|
||||
project_id: ActiveValue::set(project_id),
|
||||
worktree_id: ActiveValue::set(worktree_id),
|
||||
@@ -622,7 +622,8 @@ impl Database {
|
||||
) -> Result<TransactionGuard<Vec<ConnectionId>>> {
|
||||
let project_id = ProjectId::from_proto(update.project_id);
|
||||
let kind = match update.kind {
|
||||
Some(kind) => proto::LocalSettingsKind::from_i32(kind)
|
||||
Some(kind) => proto::LocalSettingsKind::try_from(kind)
|
||||
.ok()
|
||||
.with_context(|| format!("unknown worktree settings kind: {kind}"))?,
|
||||
None => proto::LocalSettingsKind::Settings,
|
||||
};
|
||||
|
||||
@@ -656,7 +656,7 @@ impl Server {
|
||||
peer.send(
|
||||
contact_conn_id,
|
||||
proto::UpdateContacts {
|
||||
contacts: vec![updated_contact.clone()],
|
||||
contacts: vec![updated_contact],
|
||||
remove_contacts: Default::default(),
|
||||
incoming_requests: Default::default(),
|
||||
remove_incoming_requests: Default::default(),
|
||||
@@ -1945,7 +1945,7 @@ async fn unshare_project_internal(
|
||||
broadcast(
|
||||
Some(connection_id),
|
||||
guest_connection_ids.iter().copied(),
|
||||
|conn_id| session.peer.send(conn_id, message.clone()),
|
||||
|conn_id| session.peer.send(conn_id, message),
|
||||
);
|
||||
if let Some(room) = room {
|
||||
room_updated(room, &session.peer);
|
||||
@@ -2259,7 +2259,7 @@ async fn remove_repository(
|
||||
|connection_id| {
|
||||
session
|
||||
.peer
|
||||
.forward_send(session.connection_id, connection_id, request.clone())
|
||||
.forward_send(session.connection_id, connection_id, request)
|
||||
},
|
||||
);
|
||||
response.send(proto::Ack {})?;
|
||||
@@ -4037,7 +4037,7 @@ async fn update_user_contacts(user_id: UserId, session: &Session) -> Result<()>
|
||||
.send(
|
||||
contact_conn_id,
|
||||
proto::UpdateContacts {
|
||||
contacts: vec![updated_contact.clone()],
|
||||
contacts: vec![updated_contact],
|
||||
remove_contacts: Default::default(),
|
||||
incoming_requests: Default::default(),
|
||||
remove_incoming_requests: Default::default(),
|
||||
|
||||
@@ -55,7 +55,7 @@ impl ProtoConversion for dap_types::Scope {
|
||||
fn from_proto(payload: Self::ProtoType) -> Self {
|
||||
let presentation_hint = payload
|
||||
.presentation_hint
|
||||
.and_then(DapScopePresentationHint::from_i32);
|
||||
.and_then(|value| DapScopePresentationHint::try_from(value).ok());
|
||||
Self {
|
||||
name: payload.name,
|
||||
presentation_hint: presentation_hint.map(ScopePresentationHint::from_proto),
|
||||
@@ -222,7 +222,7 @@ impl ProtoConversion for dap_types::Source {
|
||||
source_reference: payload.source_reference,
|
||||
presentation_hint: payload
|
||||
.presentation_hint
|
||||
.and_then(DapSourcePresentationHint::from_i32)
|
||||
.and_then(|value| DapSourcePresentationHint::try_from(value).ok())
|
||||
.map(dap_types::SourcePresentationHint::from_proto),
|
||||
origin: payload.origin,
|
||||
sources: Some(Vec::<dap_types::Source>::from_proto(payload.sources)),
|
||||
@@ -401,7 +401,7 @@ impl ProtoConversion for dap_types::OutputEvent {
|
||||
Self {
|
||||
category: payload
|
||||
.category
|
||||
.and_then(proto::DapOutputCategory::from_i32)
|
||||
.and_then(|value| proto::DapOutputCategory::try_from(value).ok())
|
||||
.map(OutputEventCategory::from_proto),
|
||||
output: payload.output,
|
||||
variables_reference: payload.variables_reference,
|
||||
@@ -410,7 +410,7 @@ impl ProtoConversion for dap_types::OutputEvent {
|
||||
column: payload.column.map(|column| column as u64),
|
||||
group: payload
|
||||
.group
|
||||
.and_then(proto::DapOutputEventGroup::from_i32)
|
||||
.and_then(|value| proto::DapOutputEventGroup::try_from(value).ok())
|
||||
.map(OutputEventGroup::from_proto),
|
||||
data: None,
|
||||
location_reference: None,
|
||||
|
||||
@@ -617,7 +617,7 @@ fn deserialize_anchor(anchor: proto::EditorAnchor, buffer: &MultiBufferSnapshot)
|
||||
let text_anchor = language::proto::deserialize_anchor(anchor)?;
|
||||
buffer.anchor_in_buffer(text_anchor)
|
||||
} else {
|
||||
match proto::Bias::from_i32(anchor.bias)? {
|
||||
match proto::Bias::try_from(anchor.bias).ok()? {
|
||||
proto::Bias::Left => Some(Anchor::Min),
|
||||
proto::Bias::Right => Some(Anchor::Max),
|
||||
}
|
||||
|
||||
@@ -16,5 +16,7 @@ path = "src/http_client_tls.rs"
|
||||
doctest = true
|
||||
|
||||
[dependencies]
|
||||
log.workspace = true
|
||||
rustls.workspace = true
|
||||
rustls-platform-verifier.workspace = true
|
||||
webpki-roots.workspace = true
|
||||
@@ -15,7 +15,16 @@ pub fn tls_config() -> ClientConfig {
|
||||
.install_default()
|
||||
.ok();
|
||||
|
||||
ClientConfig::with_platform_verifier()
|
||||
ClientConfig::with_platform_verifier().unwrap_or_else(|error| {
|
||||
log::error!(
|
||||
"failed to load platform TLS certificate verifier, falling back to bundled webpki roots: {error}"
|
||||
);
|
||||
ClientConfig::builder()
|
||||
.with_root_certificates(rustls::RootCertStore {
|
||||
roots: webpki_roots::TLS_SERVER_ROOTS.to_vec(),
|
||||
})
|
||||
.with_no_client_auth()
|
||||
})
|
||||
})
|
||||
.clone()
|
||||
}
|
||||
@@ -1018,7 +1018,9 @@ impl Buffer {
|
||||
let buffer = TextBuffer::new(replica_id, buffer_id, message.base_text);
|
||||
let mut this = Self::build(buffer, file, capability);
|
||||
this.text.set_line_ending(proto::deserialize_line_ending(
|
||||
rpc::proto::LineEnding::from_i32(message.line_ending).context("missing line_ending")?,
|
||||
rpc::proto::LineEnding::try_from(message.line_ending)
|
||||
.ok()
|
||||
.context("missing line_ending")?,
|
||||
));
|
||||
this.saved_version = proto::deserialize_version(&message.saved_version);
|
||||
this.saved_mtime = message.saved_mtime.map(|time| time.into());
|
||||
|
||||
@@ -332,7 +332,8 @@ pub fn deserialize_operation(message: proto::Operation) -> Result<crate::Operati
|
||||
selections: Arc::from(selections),
|
||||
line_mode: message.line_mode,
|
||||
cursor_shape: deserialize_cursor_shape(
|
||||
proto::CursorShape::from_i32(message.cursor_shape)
|
||||
proto::CursorShape::try_from(message.cursor_shape)
|
||||
.ok()
|
||||
.context("Missing cursor shape")?,
|
||||
),
|
||||
}
|
||||
@@ -364,7 +365,8 @@ pub fn deserialize_operation(message: proto::Operation) -> Result<crate::Operati
|
||||
value: message.lamport_timestamp,
|
||||
},
|
||||
line_ending: deserialize_line_ending(
|
||||
proto::LineEnding::from_i32(message.line_ending)
|
||||
proto::LineEnding::try_from(message.line_ending)
|
||||
.ok()
|
||||
.context("missing line_ending")?,
|
||||
),
|
||||
}
|
||||
@@ -446,7 +448,9 @@ pub fn deserialize_diagnostics(
|
||||
deserialize_anchor(diagnostic.start?)?..deserialize_anchor(diagnostic.end?)?,
|
||||
Diagnostic {
|
||||
source: diagnostic.source,
|
||||
severity: match proto::diagnostic::Severity::from_i32(diagnostic.severity)? {
|
||||
severity: match proto::diagnostic::Severity::try_from(diagnostic.severity)
|
||||
.ok()?
|
||||
{
|
||||
proto::diagnostic::Severity::Error => DiagnosticSeverity::ERROR,
|
||||
proto::diagnostic::Severity::Warning => DiagnosticSeverity::WARNING,
|
||||
proto::diagnostic::Severity::Information => DiagnosticSeverity::INFORMATION,
|
||||
@@ -465,9 +469,11 @@ pub fn deserialize_diagnostics(
|
||||
is_unnecessary: diagnostic.is_unnecessary,
|
||||
underline: diagnostic.underline,
|
||||
registration_id: diagnostic.registration_id.map(SharedString::from),
|
||||
source_kind: match proto::diagnostic::SourceKind::from_i32(
|
||||
source_kind: match proto::diagnostic::SourceKind::try_from(
|
||||
diagnostic.source_kind,
|
||||
)? {
|
||||
)
|
||||
.ok()?
|
||||
{
|
||||
proto::diagnostic::SourceKind::Pulled => DiagnosticSourceKind::Pulled,
|
||||
proto::diagnostic::SourceKind::Pushed => DiagnosticSourceKind::Pushed,
|
||||
proto::diagnostic::SourceKind::Other => DiagnosticSourceKind::Other,
|
||||
@@ -490,7 +496,7 @@ pub fn deserialize_anchor(anchor: proto::Anchor) -> Option<Anchor> {
|
||||
replica_id: ReplicaId::new(anchor.replica_id as u16),
|
||||
value: anchor.timestamp,
|
||||
};
|
||||
let bias = match proto::Bias::from_i32(anchor.bias)? {
|
||||
let bias = match proto::Bias::try_from(anchor.bias).ok()? {
|
||||
proto::Bias::Left => Bias::Left,
|
||||
proto::Bias::Right => Bias::Right,
|
||||
};
|
||||
|
||||
@@ -967,7 +967,8 @@ impl LspButton {
|
||||
let Some(name) = name.as_ref() else {
|
||||
return;
|
||||
};
|
||||
if let Some(binary_status) = proto::ServerBinaryStatus::from_i32(*binary_status)
|
||||
if let Some(binary_status) =
|
||||
proto::ServerBinaryStatus::try_from(*binary_status).ok()
|
||||
{
|
||||
let binary_status = match binary_status {
|
||||
proto::ServerBinaryStatus::None => BinaryStatus::None,
|
||||
@@ -996,7 +997,7 @@ impl LspButton {
|
||||
};
|
||||
}
|
||||
Some(proto::status_update::Status::Health(health_status)) => {
|
||||
if let Some(health) = proto::ServerHealth::from_i32(*health_status) {
|
||||
if let Some(health) = proto::ServerHealth::try_from(*health_status).ok() {
|
||||
let health = match health {
|
||||
proto::ServerHealth::Ok => ServerHealth::Ok,
|
||||
proto::ServerHealth::Warning => ServerHealth::Warning,
|
||||
|
||||
@@ -28,6 +28,7 @@ serde.workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
prost-build.workspace = true
|
||||
protox.workspace = true
|
||||
|
||||
[package.metadata.cargo-shear]
|
||||
ignored = ["prost-types"]
|
||||
@@ -1,9 +1,12 @@
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=vendored/protocol");
|
||||
let file_descriptors = protox::compile(
|
||||
["vendored/protocol/livekit_room.proto"],
|
||||
["vendored/protocol"],
|
||||
)
|
||||
.unwrap();
|
||||
prost_build::Config::new()
|
||||
.type_attribute("SendDataResponse", "#[allow(clippy::empty_docs)]")
|
||||
.compile_protos(
|
||||
&["vendored/protocol/livekit_room.proto"],
|
||||
&["vendored/protocol"],
|
||||
)
|
||||
.compile_fds(file_descriptors)
|
||||
.unwrap();
|
||||
}
|
||||
@@ -73,7 +73,7 @@ impl LiveKitClient {
|
||||
body: Req,
|
||||
) -> impl Future<Output = Result<Res>>
|
||||
where
|
||||
Req: Message,
|
||||
Req: Message + std::fmt::Debug,
|
||||
Res: Default + Message,
|
||||
{
|
||||
let client = self.http.clone();
|
||||
|
||||
@@ -1497,7 +1497,7 @@ impl BufferStore {
|
||||
) -> Result<()> {
|
||||
let buffer_id = BufferId::new(envelope.payload.buffer_id)?;
|
||||
let version = deserialize_version(&envelope.payload.version);
|
||||
let mtime = envelope.payload.mtime.clone().map(|time| time.into());
|
||||
let mtime = envelope.payload.mtime.map(|time| time.into());
|
||||
this.update(&mut cx, move |this, cx| {
|
||||
if let Some(buffer) = this.get_possibly_incomplete(buffer_id) {
|
||||
buffer.update(cx, |buffer, cx| {
|
||||
@@ -1526,9 +1526,10 @@ impl BufferStore {
|
||||
) -> Result<()> {
|
||||
let buffer_id = BufferId::new(envelope.payload.buffer_id)?;
|
||||
let version = deserialize_version(&envelope.payload.version);
|
||||
let mtime = envelope.payload.mtime.clone().map(|time| time.into());
|
||||
let mtime = envelope.payload.mtime.map(|time| time.into());
|
||||
let line_ending = deserialize_line_ending(
|
||||
proto::LineEnding::from_i32(envelope.payload.line_ending)
|
||||
proto::LineEnding::try_from(envelope.payload.line_ending)
|
||||
.ok()
|
||||
.context("missing line ending")?,
|
||||
);
|
||||
this.update(&mut cx, |this, cx| {
|
||||
|
||||
@@ -242,8 +242,7 @@ impl BreakpointStore {
|
||||
.breakpoints
|
||||
.into_iter()
|
||||
.filter_map(|breakpoint| {
|
||||
let position =
|
||||
language::proto::deserialize_anchor(breakpoint.position.clone()?)?;
|
||||
let position = language::proto::deserialize_anchor(breakpoint.position?)?;
|
||||
let session_state = breakpoint
|
||||
.session_state
|
||||
.iter()
|
||||
@@ -295,7 +294,6 @@ impl BreakpointStore {
|
||||
let position = language::proto::deserialize_anchor(
|
||||
breakpoint
|
||||
.position
|
||||
.clone()
|
||||
.context("Anchor not present in RPC payload")?,
|
||||
)
|
||||
.context("Anchor deserialization failed")?;
|
||||
@@ -1032,7 +1030,7 @@ impl Breakpoint {
|
||||
|
||||
fn from_proto(breakpoint: client::proto::Breakpoint) -> Option<Self> {
|
||||
Some(Self {
|
||||
state: match proto::BreakpointState::from_i32(breakpoint.state) {
|
||||
state: match proto::BreakpointState::try_from(breakpoint.state).ok() {
|
||||
Some(proto::BreakpointState::Disabled) => BreakpointState::Disabled,
|
||||
None | Some(proto::BreakpointState::Enabled) => BreakpointState::Enabled,
|
||||
},
|
||||
|
||||
@@ -165,7 +165,7 @@ impl DapCommand for NextCommand {
|
||||
|
||||
fn from_proto(request: &Self::ProtoRequest) -> Self {
|
||||
Self {
|
||||
inner: StepCommand::from_proto(request.clone()),
|
||||
inner: StepCommand::from_proto(*request),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5400,7 +5400,7 @@ impl BufferGitState {
|
||||
) {
|
||||
use proto::update_diff_bases::Mode;
|
||||
|
||||
let Some(mode) = Mode::from_i32(message.mode) else {
|
||||
let Some(mode) = Mode::try_from(message.mode).ok() else {
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -10105,7 +10105,7 @@ impl Repository {
|
||||
buffer_id: buffer_id.to_proto(),
|
||||
})
|
||||
.await?;
|
||||
let mode = Mode::from_i32(response.mode).context("Invalid mode")?;
|
||||
let mode = Mode::try_from(response.mode).ok().context("Invalid mode")?;
|
||||
let bases = match mode {
|
||||
Mode::IndexMatchesHead => DiffBasesChange::SetBoth(response.committed_text),
|
||||
Mode::IndexAndHead => DiffBasesChange::SetEach {
|
||||
@@ -12247,7 +12247,8 @@ fn status_from_proto(
|
||||
use proto::git_file_status::Variant;
|
||||
|
||||
let Some(variant) = status.and_then(|status| status.variant) else {
|
||||
let code = proto::GitStatus::from_i32(simple_status)
|
||||
let code = proto::GitStatus::try_from(simple_status)
|
||||
.ok()
|
||||
.with_context(|| format!("Invalid git status code: {simple_status}"))?;
|
||||
let result = match code {
|
||||
proto::GitStatus::Added => TrackedStatus {
|
||||
@@ -12281,7 +12282,8 @@ fn status_from_proto(
|
||||
Variant::Unmerged(unmerged) => {
|
||||
let [first_head, second_head] =
|
||||
[unmerged.first_head, unmerged.second_head].map(|head| {
|
||||
let code = proto::GitStatus::from_i32(head)
|
||||
let code = proto::GitStatus::try_from(head)
|
||||
.ok()
|
||||
.with_context(|| format!("Invalid git status code: {head}"))?;
|
||||
let result = match code {
|
||||
proto::GitStatus::Added => UnmergedStatusCode::Added,
|
||||
@@ -12301,7 +12303,8 @@ fn status_from_proto(
|
||||
Variant::Tracked(tracked) => {
|
||||
let [index_status, worktree_status] = [tracked.index_status, tracked.worktree_status]
|
||||
.map(|status| {
|
||||
let code = proto::GitStatus::from_i32(status)
|
||||
let code = proto::GitStatus::try_from(status)
|
||||
.ok()
|
||||
.with_context(|| format!("Invalid git status code: {status}"))?;
|
||||
let result = match code {
|
||||
proto::GitStatus::Modified => StatusCode::Modified,
|
||||
|
||||
@@ -1963,7 +1963,7 @@ impl LspCommand for GetDocumentHighlights {
|
||||
buffer
|
||||
.update(&mut cx, |buffer, _| buffer.wait_for_anchors([start, end]))
|
||||
.await?;
|
||||
let kind = match proto::document_highlight::Kind::from_i32(highlight.kind) {
|
||||
let kind = match proto::document_highlight::Kind::try_from(highlight.kind).ok() {
|
||||
Some(proto::document_highlight::Kind::Text) => DocumentHighlightKind::TEXT,
|
||||
Some(proto::document_highlight::Kind::Read) => DocumentHighlightKind::READ,
|
||||
Some(proto::document_highlight::Kind::Write) => DocumentHighlightKind::WRITE,
|
||||
@@ -4489,7 +4489,7 @@ impl GetDocumentDiagnostics {
|
||||
let tags = diagnostic
|
||||
.tags
|
||||
.into_iter()
|
||||
.filter_map(|tag| match proto::LspDiagnosticTag::from_i32(tag) {
|
||||
.filter_map(|tag| match proto::LspDiagnosticTag::try_from(tag).ok() {
|
||||
Some(proto::LspDiagnosticTag::Unnecessary) => Some(lsp::DiagnosticTag::UNNECESSARY),
|
||||
Some(proto::LspDiagnosticTag::Deprecated) => Some(lsp::DiagnosticTag::DEPRECATED),
|
||||
_ => None,
|
||||
@@ -4498,7 +4498,9 @@ impl GetDocumentDiagnostics {
|
||||
|
||||
Ok(lsp::Diagnostic {
|
||||
range: language::range_to_lsp(range)?,
|
||||
severity: match proto::lsp_diagnostic::Severity::from_i32(diagnostic.severity).unwrap()
|
||||
severity: match proto::lsp_diagnostic::Severity::try_from(diagnostic.severity)
|
||||
.ok()
|
||||
.unwrap()
|
||||
{
|
||||
proto::lsp_diagnostic::Severity::Error => Some(lsp::DiagnosticSeverity::ERROR),
|
||||
proto::lsp_diagnostic::Severity::Warning => Some(lsp::DiagnosticSeverity::WARNING),
|
||||
|
||||
@@ -9781,7 +9781,7 @@ impl LspStore {
|
||||
let server_id = lsp_query.server_id.map(LanguageServerId::from_proto);
|
||||
match lsp_query.request.context("invalid LSP query request")? {
|
||||
Request::GetReferences(get_references) => {
|
||||
let position = get_references.position.clone().and_then(deserialize_anchor);
|
||||
let position = get_references.position.and_then(deserialize_anchor);
|
||||
Self::query_lsp_locally::<GetReferences>(
|
||||
lsp_store,
|
||||
server_id,
|
||||
@@ -9860,7 +9860,7 @@ impl LspStore {
|
||||
});
|
||||
}
|
||||
Request::GetHover(get_hover) => {
|
||||
let position = get_hover.position.clone().and_then(deserialize_anchor);
|
||||
let position = get_hover.position.and_then(deserialize_anchor);
|
||||
Self::query_lsp_locally::<GetHover>(
|
||||
lsp_store,
|
||||
server_id,
|
||||
@@ -9885,10 +9885,7 @@ impl LspStore {
|
||||
.await?;
|
||||
}
|
||||
Request::GetSignatureHelp(get_signature_help) => {
|
||||
let position = get_signature_help
|
||||
.position
|
||||
.clone()
|
||||
.and_then(deserialize_anchor);
|
||||
let position = get_signature_help.position.and_then(deserialize_anchor);
|
||||
Self::query_lsp_locally::<GetSignatureHelp>(
|
||||
lsp_store,
|
||||
server_id,
|
||||
@@ -9913,7 +9910,7 @@ impl LspStore {
|
||||
.await?;
|
||||
}
|
||||
Request::GetDefinition(get_definition) => {
|
||||
let position = get_definition.position.clone().and_then(deserialize_anchor);
|
||||
let position = get_definition.position.and_then(deserialize_anchor);
|
||||
Self::query_lsp_locally::<GetDefinitions>(
|
||||
lsp_store,
|
||||
server_id,
|
||||
@@ -9928,7 +9925,6 @@ impl LspStore {
|
||||
Request::GetEditPredictionDefinition(get_edit_prediction_definition) => {
|
||||
let position = get_edit_prediction_definition
|
||||
.position
|
||||
.clone()
|
||||
.and_then(deserialize_anchor);
|
||||
Self::query_lsp_locally::<GetEditPredictionDefinitions>(
|
||||
lsp_store,
|
||||
@@ -9942,10 +9938,7 @@ impl LspStore {
|
||||
.await?;
|
||||
}
|
||||
Request::GetDeclaration(get_declaration) => {
|
||||
let position = get_declaration
|
||||
.position
|
||||
.clone()
|
||||
.and_then(deserialize_anchor);
|
||||
let position = get_declaration.position.and_then(deserialize_anchor);
|
||||
Self::query_lsp_locally::<GetDeclarations>(
|
||||
lsp_store,
|
||||
server_id,
|
||||
@@ -9958,10 +9951,7 @@ impl LspStore {
|
||||
.await?;
|
||||
}
|
||||
Request::GetTypeDefinition(get_type_definition) => {
|
||||
let position = get_type_definition
|
||||
.position
|
||||
.clone()
|
||||
.and_then(deserialize_anchor);
|
||||
let position = get_type_definition.position.and_then(deserialize_anchor);
|
||||
Self::query_lsp_locally::<GetTypeDefinitions>(
|
||||
lsp_store,
|
||||
server_id,
|
||||
@@ -9976,7 +9966,6 @@ impl LspStore {
|
||||
Request::GetEditPredictionTypeDefinition(get_edit_prediction_type_definition) => {
|
||||
let position = get_edit_prediction_type_definition
|
||||
.position
|
||||
.clone()
|
||||
.and_then(deserialize_anchor);
|
||||
Self::query_lsp_locally::<GetEditPredictionTypeDefinitions>(
|
||||
lsp_store,
|
||||
@@ -9990,10 +9979,7 @@ impl LspStore {
|
||||
.await?;
|
||||
}
|
||||
Request::GetImplementation(get_implementation) => {
|
||||
let position = get_implementation
|
||||
.position
|
||||
.clone()
|
||||
.and_then(deserialize_anchor);
|
||||
let position = get_implementation.position.and_then(deserialize_anchor);
|
||||
Self::query_lsp_locally::<GetImplementations>(
|
||||
lsp_store,
|
||||
server_id,
|
||||
@@ -10008,12 +9994,10 @@ impl LspStore {
|
||||
Request::InlayHints(inlay_hints) => {
|
||||
let query_start = inlay_hints
|
||||
.start
|
||||
.clone()
|
||||
.and_then(deserialize_anchor)
|
||||
.context("invalid inlay hints range start")?;
|
||||
let query_end = inlay_hints
|
||||
.end
|
||||
.clone()
|
||||
.and_then(deserialize_anchor)
|
||||
.context("invalid inlay hints range end")?;
|
||||
Self::deduplicate_range_based_lsp_requests::<InlayHints>(
|
||||
@@ -11666,7 +11650,7 @@ impl LspStore {
|
||||
.ranges
|
||||
.iter()
|
||||
.map(|range| {
|
||||
deserialize_anchor_range(range.clone()).context("invalid anchor range")
|
||||
deserialize_anchor_range(*range).context("invalid anchor range")
|
||||
})
|
||||
.collect();
|
||||
ranges_map.insert(buffer_id, ranges?);
|
||||
@@ -12989,7 +12973,7 @@ impl LspStore {
|
||||
Ok(CoreCompletion {
|
||||
replace_range: old_replace_start..old_replace_end,
|
||||
new_text: completion.new_text,
|
||||
source: match proto::completion::Source::from_i32(completion.source) {
|
||||
source: match proto::completion::Source::try_from(completion.source).ok() {
|
||||
Some(proto::completion::Source::Custom) => CompletionSource::Custom,
|
||||
Some(proto::completion::Source::Lsp) => CompletionSource::Lsp {
|
||||
insert_range,
|
||||
@@ -13061,7 +13045,7 @@ impl LspStore {
|
||||
.end
|
||||
.and_then(deserialize_anchor)
|
||||
.context("invalid end")?;
|
||||
let lsp_action = match proto::code_action::Kind::from_i32(action.kind) {
|
||||
let lsp_action = match proto::code_action::Kind::try_from(action.kind).ok() {
|
||||
Some(proto::code_action::Kind::Action) => {
|
||||
LspAction::Action(serde_json::from_slice(&action.lsp_action)?)
|
||||
}
|
||||
@@ -14447,7 +14431,10 @@ impl LanguageServerLogType {
|
||||
use proto::rpc_message;
|
||||
match log_type {
|
||||
proto::language_server_log::LogType::Log(message_type) => Self::Log(
|
||||
match LogLevel::from_i32(message_type.level).unwrap_or(LogLevel::Log) {
|
||||
match LogLevel::try_from(message_type.level)
|
||||
.ok()
|
||||
.unwrap_or(LogLevel::Log)
|
||||
{
|
||||
LogLevel::Error => MessageType::ERROR,
|
||||
LogLevel::Warning => MessageType::WARNING,
|
||||
LogLevel::Info => MessageType::INFO,
|
||||
@@ -14458,7 +14445,8 @@ impl LanguageServerLogType {
|
||||
verbose_info: trace_message.verbose_info,
|
||||
},
|
||||
proto::language_server_log::LogType::Rpc(message) => Self::Rpc {
|
||||
received: match rpc_message::Kind::from_i32(message.kind)
|
||||
received: match rpc_message::Kind::try_from(message.kind)
|
||||
.ok()
|
||||
.unwrap_or(rpc_message::Kind::Received)
|
||||
{
|
||||
rpc_message::Kind::Received => true,
|
||||
|
||||
@@ -5718,7 +5718,8 @@ impl Project {
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<()> {
|
||||
let toggled_log_kind =
|
||||
match proto::toggle_lsp_logs::LogType::from_i32(envelope.payload.log_type)
|
||||
match proto::toggle_lsp_logs::LogType::try_from(envelope.payload.log_type)
|
||||
.ok()
|
||||
.context("invalid log type")?
|
||||
{
|
||||
proto::toggle_lsp_logs::LogType::Log => LogKind::Logs,
|
||||
|
||||
@@ -1081,7 +1081,8 @@ impl SettingsObserver {
|
||||
mut cx: AsyncApp,
|
||||
) -> anyhow::Result<()> {
|
||||
let kind = match envelope.payload.kind {
|
||||
Some(kind) => proto::LocalSettingsKind::from_i32(kind)
|
||||
Some(kind) => proto::LocalSettingsKind::try_from(kind)
|
||||
.ok()
|
||||
.with_context(|| format!("unknown kind {kind}"))?,
|
||||
None => proto::LocalSettingsKind::Settings,
|
||||
};
|
||||
|
||||
@@ -477,7 +477,7 @@ impl SearchQuery {
|
||||
LazyLock::new(|| Regex::new(r"\\\\|\\n|\\t").unwrap());
|
||||
let replacement = TEXT_REPLACEMENT_SPECIAL_CHARACTERS_REGEX.replace_all(
|
||||
replacement,
|
||||
|c: &Captures| match c.get(0).unwrap().as_str() {
|
||||
|c: &Captures<str>| match c.get(0).unwrap().as_str() {
|
||||
r"\\" => "\\",
|
||||
r"\n" => "\n",
|
||||
r"\t" => "\t",
|
||||
|
||||
@@ -23,5 +23,6 @@ serde.workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
prost-build.workspace = true
|
||||
protox.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -1,10 +1,9 @@
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=proto");
|
||||
let file_descriptors = protox::compile(["proto/zed.proto"], ["proto"]).unwrap();
|
||||
let mut build = prost_build::Config::new();
|
||||
build
|
||||
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
|
||||
.type_attribute("ProjectPath", "#[derive(Hash, Eq)]")
|
||||
.type_attribute("Anchor", "#[derive(Hash, Eq)]")
|
||||
.compile_protos(&["proto/zed.proto"], &["proto"])
|
||||
.compile_fds(file_descriptors)
|
||||
.unwrap();
|
||||
}
|
||||
@@ -138,10 +138,6 @@ impl PeerId {
|
||||
}
|
||||
}
|
||||
|
||||
impl Copy for PeerId {}
|
||||
|
||||
impl Eq for PeerId {}
|
||||
|
||||
impl Ord for PeerId {
|
||||
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
||||
self.owner_id
|
||||
@@ -156,13 +152,6 @@ impl PartialOrd for PeerId {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::hash::Hash for PeerId {
|
||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||
self.owner_id.hash(state);
|
||||
self.id.hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for PeerId {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{}/{}", self.owner_id, self.id)
|
||||
|
||||
@@ -848,7 +848,8 @@ impl HeadlessProject {
|
||||
.map(|global_log_store| global_log_store.0.clone())
|
||||
.context("lsp logs store is missing")?;
|
||||
let toggled_log_kind =
|
||||
match proto::toggle_lsp_logs::LogType::from_i32(envelope.payload.log_type)
|
||||
match proto::toggle_lsp_logs::LogType::try_from(envelope.payload.log_type)
|
||||
.ok()
|
||||
.context("invalid log type")?
|
||||
{
|
||||
proto::toggle_lsp_logs::LogType::Log => LogKind::Logs,
|
||||
|
||||
@@ -829,7 +829,7 @@ mod tests {
|
||||
peer.respond(receipt, proto::Ack {})?
|
||||
} else if let Some(envelope) = envelope.downcast_ref::<TypedEnvelope<proto::Test>>()
|
||||
{
|
||||
peer.respond(envelope.receipt(), envelope.payload.clone())?
|
||||
peer.respond(envelope.receipt(), envelope.payload)?
|
||||
} else {
|
||||
panic!("unknown message type");
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ nix = { workspace = true, features = ["user"] }
|
||||
mach2.workspace = true
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
tendril = "0.4.3"
|
||||
tendril = "0.5"
|
||||
windows.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -6102,7 +6102,7 @@ impl Workspace {
|
||||
state.active_view_id = response
|
||||
.active_view
|
||||
.as_ref()
|
||||
.and_then(|view| ViewId::from_proto(view.id.clone()?).ok());
|
||||
.and_then(|view| ViewId::from_proto(view.id?).ok());
|
||||
anyhow::Ok(())
|
||||
})??;
|
||||
if let Some(view) = response.active_view {
|
||||
@@ -6559,7 +6559,7 @@ impl Workspace {
|
||||
) -> Result<()> {
|
||||
match update.variant.context("invalid update")? {
|
||||
proto::update_followers::Variant::CreateView(view) => {
|
||||
let view_id = ViewId::from_proto(view.id.clone().context("invalid view id")?)?;
|
||||
let view_id = ViewId::from_proto(view.id.context("invalid view id")?)?;
|
||||
let should_add_view = this.update(cx, |this, _| {
|
||||
if let Some(state) = this.follower_states.get_mut(&leader_id.into()) {
|
||||
anyhow::Ok(!state.items_by_leader_view_id.contains_key(&view_id))
|
||||
@@ -6578,7 +6578,7 @@ impl Workspace {
|
||||
state.active_view_id = update_active_view
|
||||
.view
|
||||
.as_ref()
|
||||
.and_then(|view| ViewId::from_proto(view.id.clone()?).ok());
|
||||
.and_then(|view| ViewId::from_proto(view.id?).ok());
|
||||
|
||||
if state.active_view_id.is_some_and(|view_id| {
|
||||
!state.items_by_leader_view_id.contains_key(&view_id)
|
||||
@@ -6603,7 +6603,7 @@ impl Workspace {
|
||||
this.update_in(cx, |this, window, cx| {
|
||||
let project = this.project.clone();
|
||||
if let Some(state) = this.follower_states.get(&leader_id.into()) {
|
||||
let view_id = ViewId::from_proto(id.clone())?;
|
||||
let view_id = ViewId::from_proto(id)?;
|
||||
if let Some(item) = state.items_by_leader_view_id.get(&view_id) {
|
||||
tasks.push(item.view.apply_update_proto(
|
||||
&project,
|
||||
@@ -6632,11 +6632,13 @@ impl Workspace {
|
||||
) -> Result<()> {
|
||||
let this = this.upgrade().context("workspace dropped")?;
|
||||
|
||||
let Some(id) = view.id.clone() else {
|
||||
let Some(id) = view.id else {
|
||||
anyhow::bail!("no id for view");
|
||||
};
|
||||
let id = ViewId::from_proto(id)?;
|
||||
let panel_id = view.panel_id.and_then(proto::PanelId::from_i32);
|
||||
let panel_id = view
|
||||
.panel_id
|
||||
.and_then(|value| proto::PanelId::try_from(value).ok());
|
||||
|
||||
let pane = this.update(cx, |this, _cx| {
|
||||
let state = this
|
||||
|
||||
Reference in new issue
Block a user