diff --git a/Cargo.lock b/Cargo.lock index bc11e4d7daa41e3e71df963f2c118b94bf8b589a..b442f8d71613551e843247b849a7a6eeb0a8291e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -705,17 +705,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "cache-padded" version = "1.2.0" @@ -866,6 +855,22 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chat_panel" +version = "0.1.0" +dependencies = [ + "client", + "editor", + "gpui", + "menu", + "postage", + "settings", + "theme", + "time 0.3.15", + "util", + "workspace", +] + [[package]] name = "chrono" version = "0.4.22" @@ -1586,8 +1591,13 @@ dependencies = [ "async-trait", "collections", "gpui", + "lazy_static", + "log", "parking_lot 0.11.2", - "rocksdb", + "rusqlite", + "rusqlite_migration", + "serde", + "serde_rusqlite", "tempdir", ] @@ -1907,6 +1917,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + [[package]] name = "fastrand" version = "1.8.0" @@ -3102,17 +3118,14 @@ dependencies = [ ] [[package]] -name = "librocksdb-sys" -version = "0.7.1+7.3.1" -source = "git+https://github.com/rust-rocksdb/rust-rocksdb?rev=39dc822dde743b2a26eb160b660e8fbdab079d49#39dc822dde743b2a26eb160b660e8fbdab079d49" +name = "libsqlite3-sys" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f0455f2c1bc9a7caa792907026e469c1d91761fb0ea37cbb16427c77280cf35" dependencies = [ - "bindgen", - "bzip2-sys", "cc", - "glob", - "libc", - "libz-sys", - "zstd-sys", + "pkg-config", + "vcpkg", ] [[package]] @@ -4229,7 +4242,6 @@ dependencies = [ "pulldown-cmark", "rand 0.8.5", "regex", - "rocksdb", "rpc", "serde", "serde_json", @@ -4728,15 +4740,6 @@ dependencies = [ "rmp", ] -[[package]] -name = "rocksdb" -version = "0.18.0" -source = "git+https://github.com/rust-rocksdb/rust-rocksdb?rev=39dc822dde743b2a26eb160b660e8fbdab079d49#39dc822dde743b2a26eb160b660e8fbdab079d49" -dependencies = [ - "libc", - "librocksdb-sys", -] - [[package]] name = "rope" version = "0.1.0" @@ -4808,6 +4811,31 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rusqlite" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "serde_json", + "smallvec", +] + +[[package]] +name = "rusqlite_migration" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda44233be97aea786691f9f6f7ef230bcf905061f4012e90f4f39e6dcf31163" +dependencies = [ + "log", + "rusqlite", +] + [[package]] name = "rust-embed" version = "6.4.1" @@ -5203,6 +5231,16 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_rusqlite" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "538b51f10ee271375cbd9caa04fa6e3e50af431a21db97caae48da92a074244a" +dependencies = [ + "rusqlite", + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -5809,6 +5847,7 @@ dependencies = [ "futures 0.3.24", "gpui", "itertools", + "language", "lazy_static", "libc", "mio-extras", @@ -7580,7 +7619,7 @@ dependencies = [ [[package]] name = "zed" -version = "0.60.4" +version = "0.61.0" dependencies = [ "activity_indicator", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 8d2a3fcc407aba85766a3be828a4fc394eca3f38..7e3623af98b466ec9f79b9490f2bbd64f8c455cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,6 @@ cocoa-foundation = { git = "https://github.com/servo/core-foundation-rs", rev = core-foundation = { git = "https://github.com/servo/core-foundation-rs", rev = "079665882507dd5e2ff77db3de5070c1f6c0fb85" } core-foundation-sys = { git = "https://github.com/servo/core-foundation-rs", rev = "079665882507dd5e2ff77db3de5070c1f6c0fb85" } core-graphics = { git = "https://github.com/servo/core-foundation-rs", rev = "079665882507dd5e2ff77db3de5070c1f6c0fb85" } -# TODO - Remove when a new version of RustRocksDB is released -rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb", rev = "39dc822dde743b2a26eb160b660e8fbdab079d49" } [profile.dev] split-debuginfo = "unpacked" diff --git a/Procfile b/Procfile index a64b411ef3224a8b6bbf4596bff109b125462bf4..e1b87dd48b6eea968a4dfa24f468f5c5acb7f3c0 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ -web: cd ../zed.dev && PORT=3000 npx next dev +web: cd ../zed.dev && PORT=3000 npx vercel dev collab: cd crates/collab && cargo run diff --git a/assets/settings/default.json b/assets/settings/default.json index 2ccd2c5f973b4578d62b1639c643c75d020f5a60..51aa108cd98a7bd5d16af5882b4293cca112239c 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -10,6 +10,8 @@ // Whether to show the informational hover box when moving the mouse // over symbols in the editor. "hover_popover_enabled": true, + // Whether the cursor blinks in the editor. + "cursor_blink": true, // Whether to pop the completions menu while typing in an editor without // explicitly requesting it. "show_completions_on_input": true, diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rs index d32835547c6c1ba5903eb9251fa776d5a7bc5544..efe36ccab8ae913e3b402d1f38e7d883489fd923 100644 --- a/crates/auto_update/src/auto_update.rs +++ b/crates/auto_update/src/auto_update.rs @@ -40,7 +40,7 @@ pub struct AutoUpdater { current_version: AppVersion, http_client: Arc, pending_poll: Option>, - db: Arc, + db: project::Db, server_url: String, } @@ -55,7 +55,7 @@ impl Entity for AutoUpdater { } pub fn init( - db: Arc, + db: project::Db, http_client: Arc, server_url: String, cx: &mut MutableAppContext, @@ -116,7 +116,7 @@ impl AutoUpdater { fn new( current_version: AppVersion, - db: Arc, + db: project::Db, http_client: Arc, server_url: String, ) -> Self { @@ -283,9 +283,9 @@ impl AutoUpdater { let db = self.db.clone(); cx.background().spawn(async move { if should_show { - db.write([(SHOULD_SHOW_UPDATE_NOTIFICATION_KEY, "")])?; + db.write_kvp(SHOULD_SHOW_UPDATE_NOTIFICATION_KEY, "")?; } else { - db.delete([(SHOULD_SHOW_UPDATE_NOTIFICATION_KEY)])?; + db.delete_kvp(SHOULD_SHOW_UPDATE_NOTIFICATION_KEY)?; } Ok(()) }) @@ -293,8 +293,7 @@ impl AutoUpdater { fn should_show_update_notification(&self, cx: &AppContext) -> Task> { let db = self.db.clone(); - cx.background().spawn(async move { - Ok(db.read([(SHOULD_SHOW_UPDATE_NOTIFICATION_KEY)])?[0].is_some()) - }) + cx.background() + .spawn(async move { Ok(db.read_kvp(SHOULD_SHOW_UPDATE_NOTIFICATION_KEY)?.is_some()) }) } } diff --git a/crates/call/src/room.rs b/crates/call/src/room.rs index 09b49716e03b69c178ad8b19b5eb8a8fcd72bacd..b2e79f820d3109589a38a1d7baf0ec64bcdce027 100644 --- a/crates/call/src/room.rs +++ b/crates/call/src/room.rs @@ -8,7 +8,7 @@ use collections::{BTreeMap, HashSet}; use futures::StreamExt; use gpui::{AsyncAppContext, Entity, ModelContext, ModelHandle, MutableAppContext, Task}; use project::Project; -use std::sync::Arc; +use std::{os::unix::prelude::OsStrExt, sync::Arc}; use util::ResultExt; #[derive(Clone, Debug, PartialEq, Eq)] @@ -389,6 +389,7 @@ impl Room { id: worktree.id().to_proto(), root_name: worktree.root_name().into(), visible: worktree.is_visible(), + abs_path: worktree.abs_path().as_os_str().as_bytes().to_vec(), } }) .collect(), diff --git a/crates/chat_panel/Cargo.toml b/crates/chat_panel/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..b943757c7aa7cfe1eb0c13175cde5d4172affbc8 --- /dev/null +++ b/crates/chat_panel/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "chat_panel" +version = "0.1.0" +edition = "2021" + +[lib] +path = "src/chat_panel.rs" +doctest = false + +[dependencies] +client = { path = "../client" } +editor = { path = "../editor" } +gpui = { path = "../gpui" } +menu = { path = "../menu" } +settings = { path = "../settings" } +theme = { path = "../theme" } +util = { path = "../util" } +workspace = { path = "../workspace" } +postage = { version = "0.4.1", features = ["futures-traits"] } +time = { version = "0.3", features = ["serde", "serde-well-known"] } \ No newline at end of file diff --git a/crates/chat_panel/src/chat_panel.rs b/crates/chat_panel/src/chat_panel.rs new file mode 100644 index 0000000000000000000000000000000000000000..595eac5f7a105fe29b6277a6170e79ae50e6d698 --- /dev/null +++ b/crates/chat_panel/src/chat_panel.rs @@ -0,0 +1,434 @@ + +use client::{ + channel::{Channel, ChannelEvent, ChannelList, ChannelMessage}, + Client, +}; +use editor::Editor; +use gpui::{ + actions, + elements::*, + platform::CursorStyle, + views::{ItemType, Select, SelectStyle}, + AnyViewHandle, AppContext, Entity, ModelHandle, MouseButton, MutableAppContext, RenderContext, + Subscription, Task, View, ViewContext, ViewHandle, +}; +use menu::Confirm; +use postage::prelude::Stream; +use settings::{Settings, SoftWrap}; +use std::sync::Arc; +use time::{OffsetDateTime, UtcOffset}; +use util::{ResultExt, TryFutureExt}; + +const MESSAGE_LOADING_THRESHOLD: usize = 50; + +pub struct ChatPanel { + rpc: Arc, + channel_list: ModelHandle, + active_channel: Option<(ModelHandle, Subscription)>, + message_list: ListState, + input_editor: ViewHandle, + channel_select: ViewHandle