mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-11 21:00:35 +00:00
Call editor::init
This commit is contained in:
parent
800c2685ea
commit
cdc82d01f7
2 changed files with 13 additions and 14 deletions
|
@ -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) => {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue