Call editor::init
This commit is contained in:
@@ -414,18 +414,17 @@ type ItemDeserializers = HashMap<
|
|||||||
) -> Task<Result<Box<dyn ItemHandle>>>,
|
) -> Task<Result<Box<dyn ItemHandle>>>,
|
||||||
>;
|
>;
|
||||||
pub fn register_deserializable_item<I: Item>(cx: &mut AppContext) {
|
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() {
|
||||||
if let Some(serialized_item_kind) = I::serialized_item_kind() {
|
let deserializers = cx.default_global::<ItemDeserializers>();
|
||||||
deserializers.insert(
|
deserializers.insert(
|
||||||
Arc::from(serialized_item_kind),
|
Arc::from(serialized_item_kind),
|
||||||
|project, workspace, workspace_id, item_id, cx| {
|
|project, workspace, workspace_id, item_id, cx| {
|
||||||
let task = I::deserialize(project, workspace, workspace_id, item_id, cx);
|
let task = I::deserialize(project, workspace, workspace_id, item_id, cx);
|
||||||
cx.foreground_executor()
|
cx.foreground_executor()
|
||||||
.spawn(async { Ok(Box::new(task.await?) as Box<_>) })
|
.spawn(async { Ok(Box::new(task.await?) as Box<_>) })
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct AppState {
|
pub struct AppState {
|
||||||
@@ -627,7 +626,7 @@ impl Workspace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
project2::Event::Closed => {
|
project2::Event::Closed => {
|
||||||
// cx.remove_window();
|
cx.remove_window();
|
||||||
}
|
}
|
||||||
|
|
||||||
project2::Event::DeletedEntry(entry_id) => {
|
project2::Event::DeletedEntry(entry_id) => {
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ fn main() {
|
|||||||
client::init(&client, cx);
|
client::init(&client, cx);
|
||||||
// command_palette::init(cx);
|
// command_palette::init(cx);
|
||||||
language::init(cx);
|
language::init(cx);
|
||||||
// editor::init(cx);
|
editor::init(cx);
|
||||||
// go_to_line::init(cx);
|
// go_to_line::init(cx);
|
||||||
// file_finder::init(cx);
|
// file_finder::init(cx);
|
||||||
// outline::init(cx);
|
// outline::init(cx);
|
||||||
|
|||||||
Reference in New Issue
Block a user