From 75cf2488dbb5cf0024430724b07e8c16ba7b4468 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 4 Oct 2021 15:36:52 -0700 Subject: [PATCH] List path dependencies first in all Cargo.toml files Co-Authored-By: Nathan Sobo --- crates/buffer/Cargo.toml | 9 +++--- crates/editor/Cargo.toml | 10 +++--- crates/editor/src/lib.rs | 62 +++++++++++++++++------------------- crates/fuzzy/Cargo.toml | 2 -- crates/gpui/Cargo.toml | 5 +-- crates/rpc_client/Cargo.toml | 7 ++-- crates/server/Cargo.toml | 6 ++-- crates/worktree/Cargo.toml | 20 ++++++------ crates/zed/Cargo.toml | 38 +++++++++++----------- 9 files changed, 82 insertions(+), 77 deletions(-) diff --git a/crates/buffer/Cargo.toml b/crates/buffer/Cargo.toml index a5fb5e9c54..10d2017cf5 100644 --- a/crates/buffer/Cargo.toml +++ b/crates/buffer/Cargo.toml @@ -7,10 +7,13 @@ edition = "2018" test-support = ["rand"] [dependencies] -anyhow = "1.0.38" -arrayvec = "0.7.1" clock = { path = "../clock" } gpui = { path = "../gpui" } +rpc = { path = "../rpc" } +sum_tree = { path = "../sum_tree" } + +anyhow = "1.0.38" +arrayvec = "0.7.1" lazy_static = "1.4" log = "0.4" parking_lot = "0.11.1" @@ -19,9 +22,7 @@ seahash = "4.1" serde = { version = "1", features = ["derive"] } similar = "1.3" smallvec = { version = "1.6", features = ["union"] } -sum_tree = { path = "../sum_tree" } tree-sitter = "0.19.5" -rpc = { path = "../rpc" } [dev-dependencies] rand = "0.8.3" diff --git a/crates/editor/Cargo.toml b/crates/editor/Cargo.toml index 3c592e69c3..9e9b054d5d 100644 --- a/crates/editor/Cargo.toml +++ b/crates/editor/Cargo.toml @@ -7,10 +7,13 @@ edition = "2021" test-support = ["buffer/test-support"] [dependencies] -anyhow = "1.0" buffer = { path = "../buffer" } clock = { path = "../clock" } gpui = { path = "../gpui" } +sum_tree = { path = "../sum_tree" } +util = { path = "../util" } + +anyhow = "1.0" lazy_static = "1.4" log = "0.4" parking_lot = "0.11" @@ -18,12 +21,11 @@ postage = { version = "0.4", features = ["futures-traits"] } serde = { version = "1", features = ["derive", "rc"] } smallvec = { version = "1.6", features = ["union"] } smol = "1.2" -sum_tree = { path = "../sum_tree" } -util = { path = "../util" } [dev-dependencies] +buffer = { path = "../buffer", features = ["test-support"] } + rand = "0.8" unindent = "0.1.7" tree-sitter = "0.19" tree-sitter-rust = "0.19" -buffer = { path = "../buffer", features = ["test-support"] } diff --git a/crates/editor/src/lib.rs b/crates/editor/src/lib.rs index 056af77d28..d0553bebec 100644 --- a/crates/editor/src/lib.rs +++ b/crates/editor/src/lib.rs @@ -5,8 +5,6 @@ pub mod movement; #[cfg(test)] mod test; -// use crate::{project::ProjectPath, settings::Settings, theme::Theme, workspace}; - use buffer::*; use clock::ReplicaId; pub use display_map::DisplayPoint; @@ -2451,36 +2449,6 @@ impl Snapshot { } impl EditorStyle { - #[cfg(any(test, feature = "test-support"))] - pub fn test(font_cache: &gpui::FontCache) -> Self { - let font_family_name = Arc::from("Monaco"); - let font_properties = Default::default(); - let font_family_id = font_cache.load_family(&[&font_family_name]).unwrap(); - let font_id = font_cache - .select_font(font_family_id, &font_properties) - .unwrap(); - Self { - text: TextStyle { - font_family_name, - font_family_id, - font_id, - font_size: 14., - color: Color::from_u32(0xff0000ff), - font_properties, - underline: false, - }, - placeholder_text: None, - background: Default::default(), - gutter_background: Default::default(), - active_line_background: Default::default(), - line_number: Default::default(), - line_number_active: Default::default(), - selection: Default::default(), - guest_selections: Default::default(), - syntax: Default::default(), - } - } - fn placeholder_text(&self) -> &TextStyle { self.placeholder_text.as_ref().unwrap_or(&self.text) } @@ -2491,7 +2459,35 @@ impl EditorSettings { pub fn test(cx: &AppContext) -> Self { Self { tab_size: 4, - style: EditorStyle::test(cx.font_cache()), + style: { + let font_cache: &gpui::FontCache = cx.font_cache(); + let font_family_name = Arc::from("Monaco"); + let font_properties = Default::default(); + let font_family_id = font_cache.load_family(&[&font_family_name]).unwrap(); + let font_id = font_cache + .select_font(font_family_id, &font_properties) + .unwrap(); + EditorStyle { + text: TextStyle { + font_family_name, + font_family_id, + font_id, + font_size: 14., + color: Color::from_u32(0xff0000ff), + font_properties, + underline: false, + }, + placeholder_text: None, + background: Default::default(), + gutter_background: Default::default(), + active_line_background: Default::default(), + line_number: Default::default(), + line_number_active: Default::default(), + selection: Default::default(), + guest_selections: Default::default(), + syntax: Default::default(), + } + }, } } } diff --git a/crates/fuzzy/Cargo.toml b/crates/fuzzy/Cargo.toml index cce17a95a5..8445f40cec 100644 --- a/crates/fuzzy/Cargo.toml +++ b/crates/fuzzy/Cargo.toml @@ -2,5 +2,3 @@ name = "fuzzy" version = "0.1.0" edition = "2018" - -[dependencies] diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml index ae01eaba63..b54b17d2ab 100644 --- a/crates/gpui/Cargo.toml +++ b/crates/gpui/Cargo.toml @@ -8,11 +8,13 @@ version = "0.1.0" test-support = [] [dependencies] +gpui_macros = { path = "../gpui_macros" } +sum_tree = { path = "../sum_tree" } + async-task = "4.0.3" backtrace = "0.3" ctor = "0.1" etagere = "0.2" -gpui_macros = { path = "../gpui_macros" } image = "0.23" lazy_static = "1.4.0" log = "0.4" @@ -30,7 +32,6 @@ serde = { version = "1.0.125", features = ["derive"] } serde_json = "1.0.64" smallvec = { version = "1.6", features = ["union"] } smol = "1.2" -sum_tree = { path = "../sum_tree" } time = { version = "0.3" } tiny-skia = "0.5" tree-sitter = "0.19" diff --git a/crates/rpc_client/Cargo.toml b/crates/rpc_client/Cargo.toml index 384a8e56ea..2fd75685f8 100644 --- a/crates/rpc_client/Cargo.toml +++ b/crates/rpc_client/Cargo.toml @@ -7,10 +7,13 @@ edition = "2018" test-support = [] [dependencies] +gpui = { path = "../gpui" } +util = { path = "../util" } +rpc = { path = "../rpc" } + anyhow = "1.0.38" async-recursion = "0.3" async-tungstenite = { version = "0.14", features = ["async-tls"] } -gpui = { path = "../gpui" } lazy_static = "1.4.0" log = "0.4" parking_lot = "0.11.1" @@ -20,5 +23,3 @@ smol = "1.2.5" surf = "2.2" thiserror = "1.0.29" tiny_http = "0.8" -util = { path = "../util" } -rpc = { path = "../rpc" } diff --git a/crates/server/Cargo.toml b/crates/server/Cargo.toml index d5be7c8661..2d9f2b2c65 100644 --- a/crates/server/Cargo.toml +++ b/crates/server/Cargo.toml @@ -13,6 +13,8 @@ name = "seed" required-features = ["seed-support"] [dependencies] +rpc = { path = "../rpc" } + anyhow = "1.0.40" async-std = { version = "1.8.0", features = ["attributes"] } async-trait = "0.1.50" @@ -41,7 +43,6 @@ tide = "0.16.0" tide-compress = "0.9.0" time = "0.2" toml = "0.5.8" -rpc = { path = "../rpc" } [dependencies.async-sqlx-session] version = "0.3.0" @@ -54,9 +55,10 @@ features = ["runtime-async-std-rustls", "postgres", "time", "uuid"] [dev-dependencies] gpui = { path = "../gpui" } +zed = { path = "../zed", features = ["test-support"] } + lazy_static = "1.4" serde_json = { version = "1.0.64", features = ["preserve_order"] } -zed = { path = "../zed", features = ["test-support"] } [features] seed-support = ["lipsum"] diff --git a/crates/worktree/Cargo.toml b/crates/worktree/Cargo.toml index 4d9d4be4a1..a8e40d27fc 100644 --- a/crates/worktree/Cargo.toml +++ b/crates/worktree/Cargo.toml @@ -7,32 +7,34 @@ edition = "2018" test-support = [] [dependencies] -anyhow = "1.0.38" -async-trait = "0.1" buffer = { path = "../buffer" } clock = { path = "../clock" } fsevent = { path = "../fsevent" } -futures = "0.3" fuzzy = { path = "../fuzzy" } gpui = { path = "../gpui" } +rpc_client = { path = "../rpc_client" } +sum_tree = { path = "../sum_tree" } +util = { path = "../util" } +rpc = { path = "../rpc" } + +anyhow = "1.0.38" +async-trait = "0.1" +futures = "0.3" ignore = "0.4" lazy_static = "1.4.0" libc = "0.2" log = "0.4" parking_lot = "0.11.1" postage = { version = "0.4.1", features = ["futures-traits"] } -rpc_client = { path = "../rpc_client" } serde = { version = "1", features = ["derive"] } serde_json = { version = "1.0.64", features = ["preserve_order"] } smol = "1.2.5" -sum_tree = { path = "../sum_tree" } -util = { path = "../util" } toml = "0.5" -rpc = { path = "../rpc" } [dev-dependencies] -rand = "0.8.3" rpc_client = { path = "../rpc_client", features = ["test-support"] } -tempdir = { version = "0.3.7" } util = { path = "../util", features = ["test-support"] } rpc = { path = "../rpc", features = ["test-support"] } + +rand = "0.8.3" +tempdir = { version = "0.3.7" } diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index bd4c4d55c6..2fea72cc6c 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -24,21 +24,27 @@ test-support = [ ] [dependencies] +buffer = { path = "../buffer" } +clock = { path = "../clock" } +fsevent = { path = "../fsevent" } +fuzzy = { path = "../fuzzy" } +editor = { path = "../editor" } +gpui = { path = "../gpui" } +rpc = { path = "../rpc" } +rpc_client = { path = "../rpc_client" } +sum_tree = { path = "../sum_tree" } +util = { path = "../util" } +worktree = { path = "../worktree" } + anyhow = "1.0.38" async-recursion = "0.3" async-trait = "0.1" async-tungstenite = { version = "0.14", features = ["async-tls"] } -buffer = { path = "../buffer" } -clock = { path = "../clock" } crossbeam-channel = "0.5.0" ctor = "0.1.20" dirs = "3.0" -editor = { path = "../editor" } easy-parallel = "3.1.0" -fsevent = { path = "../fsevent" } futures = "0.3" -fuzzy = { path = "../fuzzy" } -gpui = { path = "../gpui" } http-auth-basic = "0.1.3" ignore = "0.4" image = "0.23" @@ -51,7 +57,6 @@ num_cpus = "1.13.0" parking_lot = "0.11.1" postage = { version = "0.4.1", features = ["futures-traits"] } rand = "0.8.3" -rpc_client = { path = "../rpc_client" } rsa = "0.4" rust-embed = { version = "6.2", features = ["include-exclude"] } serde = { version = "1", features = ["derive"] } @@ -60,7 +65,6 @@ serde_path_to_error = "0.1.4" simplelog = "0.9" smallvec = { version = "1.6", features = ["union"] } smol = "1.2.5" -sum_tree = { path = "../sum_tree" } surf = "2.2" tempdir = { version = "0.3.7", optional = true } thiserror = "1.0.29" @@ -70,23 +74,21 @@ toml = "0.5" tree-sitter = "0.19.5" tree-sitter-rust = "0.19.0" url = "2.2" -util = { path = "../util" } -worktree = { path = "../worktree" } -rpc = { path = "../rpc" } [dev-dependencies] +buffer = { path = "../buffer", features = ["test-support"] } +editor = { path = "../editor", features = ["test-support"] } +gpui = { path = "../gpui", features = ["test-support"] } +rpc = { path = "../rpc", features = ["test-support"] } +rpc_client = { path = "../rpc_client", features = ["test-support"] } +util = { path = "../util", features = ["test-support"] } +worktree = { path = "../worktree", features = ["test-support"] } + cargo-bundle = "0.5.0" env_logger = "0.8" serde_json = { version = "1.0.64", features = ["preserve_order"] } tempdir = { version = "0.3.7" } unindent = "0.1.7" -buffer = { path = "../buffer", features = ["test-support"] } -editor = { path = "../editor", features = ["test-support"] } -gpui = { path = "../gpui", features = ["test-support"] } -rpc_client = { path = "../rpc_client", features = ["test-support"] } -util = { path = "../util", features = ["test-support"] } -worktree = { path = "../worktree", features = ["test-support"] } -rpc = { path = "../rpc", features = ["test-support"] } [package.metadata.bundle] icon = ["app-icon@2x.png", "app-icon.png"]