Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Call editor::init
Antonio Scandurracdc82d01f775
diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rsindex 8a80ef328ae..f5f507f3b15 100644--- a/crates/workspace2/src/workspace2.rs+++ b/crates/workspace2/src/workspace2.rs@@ -414,18 +414,17 @@ type ItemDeserializers = HashMap<) -> Task<Result<Box<dyn ItemHandle>>>,>;pub fn register_deserializable_item<I: Item>(cx: &mut AppContext) {- cx.update_global(|deserializers: &mut ItemDeserializers, _cx| {- if let Some(serialized_item_kind) = I::serialized_item_kind() {- deserializers.insert(- Arc::from(serialized_item_kind),- |project, workspace, workspace_id, item_id, cx| {- let task = I::deserialize(project, workspace, workspace_id, item_id, cx);- cx.foreground_executor()- .spawn(async { Ok(Box::new(task.await?) as Box<_>) })- },- );- }- });+ if let Some(serialized_item_kind) = I::serialized_item_kind() {+ let deserializers = cx.default_global::<ItemDeserializers>();+ deserializers.insert(+ Arc::from(serialized_item_kind),+ |project, workspace, workspace_id, item_id, cx| {+ let task = I::deserialize(project, workspace, workspace_id, item_id, cx);+ cx.foreground_executor()+ .spawn(async { Ok(Box::new(task.await?) as Box<_>) })+ },+ );+ }}pub struct AppState {@@ -627,7 +626,7 @@ impl Workspace {}project2::Event::Closed => {- // cx.remove_window();+ cx.remove_window();}project2::Event::DeletedEntry(entry_id) => {diff --git a/crates/zed2/src/main.rs b/crates/zed2/src/main.rsindex 1e3b8d0d2bb..3033e93dd62 100644--- a/crates/zed2/src/main.rs+++ b/crates/zed2/src/main.rs@@ -140,7 +140,7 @@ fn main() {client::init(&client, cx);// command_palette::init(cx);language::init(cx);- // editor::init(cx);+ editor::init(cx);// go_to_line::init(cx);// file_finder::init(cx);// outline::init(cx);