Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remove some todo!'s
Kirill Bulatov625c9d89802f
diff --git a/crates/editor/src/test.rs b/crates/editor/src/test.rsindex 4ce539ad797..d3337db2581 100644--- a/crates/editor/src/test.rs+++ b/crates/editor/src/test.rs@@ -60,8 +60,7 @@ pub fn assert_text_with_selections(#[allow(dead_code)]#[cfg(any(test, feature = "test-support"))]pub(crate) fn build_editor(buffer: Model<MultiBuffer>, cx: &mut ViewContext<Editor>) -> Editor {- // todo!()- Editor::new(EditorMode::Full, buffer, None, /*None,*/ cx)+ Editor::new(EditorMode::Full, buffer, None, cx)}pub(crate) fn build_editor_with_project(@@ -69,6 +68,5 @@ pub(crate) fn build_editor_with_project(buffer: Model<MultiBuffer>,cx: &mut ViewContext<Editor>,) -> Editor {- // todo!()- Editor::new(EditorMode::Full, buffer, Some(project), /*None,*/ cx)+ Editor::new(EditorMode::Full, buffer, Some(project), cx)}diff --git a/crates/gpui/docs/key_dispatch.md b/crates/gpui/docs/key_dispatch.mdindex daf6f820cd5..804a0b57619 100644--- a/crates/gpui/docs/key_dispatch.md+++ b/crates/gpui/docs/key_dispatch.md@@ -50,7 +50,7 @@ impl Render for Menu {.on_action(|this, move: &MoveDown, cx| {// ...})- .children(todo!())+ .children(unimplemented!())}}```@@ -68,7 +68,7 @@ impl Render for Menu {.on_action(|this, move: &MoveDown, cx| {// ...})- .children(todo!())+ .children(unimplemented!())}}```diff --git a/crates/gpui/src/action.rs b/crates/gpui/src/action.rsindex e335c4255e4..81b392087ae 100644--- a/crates/gpui/src/action.rs+++ b/crates/gpui/src/action.rs@@ -203,7 +203,6 @@ macro_rules! __impl_action {)}- // todo!() why is this needed in addition to name?fn debug_name() -> &'static strwhereSelf: ::std::marker::Sizeddiff --git a/crates/gpui/src/app/test_context.rs b/crates/gpui/src/app/test_context.rsindex 0f71ea61a9e..a530aaf69b9 100644--- a/crates/gpui/src/app/test_context.rs+++ b/crates/gpui/src/app/test_context.rs@@ -467,12 +467,11 @@ impl<V> View<V> {}}- // todo!(start_waiting)- // cx.borrow().foreground_executor().start_waiting();+ cx.borrow().background_executor().start_waiting();rx.recv().await.expect("view dropped with pending condition");- // cx.borrow().foreground_executor().finish_waiting();+ cx.borrow().background_executor().finish_waiting();}}).awaitdiff --git a/crates/gpui/src/elements/overlay.rs b/crates/gpui/src/elements/overlay.rsindex eab3ee60b41..6772baa2f9c 100644--- a/crates/gpui/src/elements/overlay.rs+++ b/crates/gpui/src/elements/overlay.rs@@ -14,8 +14,8 @@ pub struct Overlay {children: SmallVec<[AnyElement; 2]>,anchor_corner: AnchorCorner,fit_mode: OverlayFitMode,- // todo!();anchor_position: Option<Point<Pixels>>,+ // todo!();// position_mode: OverlayPositionMode,}diff --git a/crates/gpui/src/platform/test/display.rs b/crates/gpui/src/platform/test/display.rsindex 95f1daf8e92..68dbb0fdf34 100644--- a/crates/gpui/src/platform/test/display.rs+++ b/crates/gpui/src/platform/test/display.rs@@ -32,7 +32,7 @@ impl PlatformDisplay for TestDisplay {}fn as_any(&self) -> &dyn std::any::Any {- todo!()+ unimplemented!()}fn bounds(&self) -> crate::Bounds<crate::GlobalPixels> {diff --git a/crates/gpui/src/platform/test/platform.rs b/crates/gpui/src/platform/test/platform.rsindex 695323e9c46..ec3d7a0ff00 100644--- a/crates/gpui/src/platform/test/platform.rs+++ b/crates/gpui/src/platform/test/platform.rs@@ -103,7 +103,6 @@ impl TestPlatform {}}-// todo!("implement out what our tests needed in GPUI 1")impl Platform for TestPlatform {fn background_executor(&self) -> BackgroundExecutor {self.background_executor.clone()diff --git a/crates/gpui/tests/action_macros.rs b/crates/gpui/tests/action_macros.rsindex 9e5f6dea16c..99572a4b3c5 100644--- a/crates/gpui/tests/action_macros.rs+++ b/crates/gpui/tests/action_macros.rs@@ -18,33 +18,33 @@ fn test_action_macros() {impl gpui::Action for RegisterableAction {fn boxed_clone(&self) -> Box<dyn gpui::Action> {- todo!()+ unimplemented!()}fn as_any(&self) -> &dyn std::any::Any {- todo!()+ unimplemented!()}fn partial_eq(&self, _action: &dyn gpui::Action) -> bool {- todo!()+ unimplemented!()}fn name(&self) -> &str {- todo!()+ unimplemented!()}fn debug_name() -> &'static strwhereSelf: Sized,{- todo!()+ unimplemented!()}fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>whereSelf: Sized,{- todo!()+ unimplemented!()}}}diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rsindex c13a00b11c8..adc4fb5c80b 100644--- a/crates/workspace/src/dock.rs+++ b/crates/workspace/src/dock.rs@@ -395,7 +395,6 @@ impl Dock {}).ok();}- // todo!() we do not use this event in the production code (even in zed1), remove itPanelEvent::Activate => {if let Some(ix) = this.panel_entriesdiff --git a/crates/workspace/src/notifications.rs b/crates/workspace/src/notifications.rsindex 394772b9c45..d70de8c13dc 100644--- a/crates/workspace/src/notifications.rs+++ b/crates/workspace/src/notifications.rs@@ -247,105 +247,6 @@ pub mod simple_message_notification {}))}}- // todo!()- // impl View for MessageNotification {- // fn ui_name() -> &'static str {- // "MessageNotification"- // }-- // fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> gpui::AnyElement<Self> {- // let theme = theme::current(cx).clone();- // let theme = &theme.simple_message_notification;-- // enum MessageNotificationTag {}-- // let click_message = self.click_message.clone();- // let message = match &self.message {- // NotificationMessage::Text(text) => {- // Text::new(text.to_owned(), theme.message.text.clone()).into_any()- // }- // NotificationMessage::Element(e) => e(theme.message.text.clone(), cx),- // };- // let on_click = self.on_click.clone();- // let has_click_action = on_click.is_some();-- // Flex::column()- // .with_child(- // Flex::row()- // .with_child(- // message- // .contained()- // .with_style(theme.message.container)- // .aligned()- // .top()- // .left()- // .flex(1., true),- // )- // .with_child(- // MouseEventHandler::new::<Cancel, _>(0, cx, |state, _| {- // let style = theme.dismiss_button.style_for(state);- // Svg::new("icons/x.svg")- // .with_color(style.color)- // .constrained()- // .with_width(style.icon_width)- // .aligned()- // .contained()- // .with_style(style.container)- // .constrained()- // .with_width(style.button_width)- // .with_height(style.button_width)- // })- // .with_padding(Padding::uniform(5.))- // .on_click(MouseButton::Left, move |_, this, cx| {- // this.dismiss(&Default::default(), cx);- // })- // .with_cursor_style(CursorStyle::PointingHand)- // .aligned()- // .constrained()- // .with_height(cx.font_cache().line_height(theme.message.text.font_size))- // .aligned()- // .top()- // .flex_float(),- // ),- // )- // .with_children({- // click_message- // .map(|click_message| {- // MouseEventHandler::new::<MessageNotificationTag, _>(- // 0,- // cx,- // |state, _| {- // let style = theme.action_message.style_for(state);-- // Flex::row()- // .with_child(- // Text::new(click_message, style.text.clone())- // .contained()- // .with_style(style.container),- // )- // .contained()- // },- // )- // .on_click(MouseButton::Left, move |_, this, cx| {- // if let Some(on_click) = on_click.as_ref() {- // on_click(cx);- // this.dismiss(&Default::default(), cx);- // }- // })- // // Since we're not using a proper overlay, we have to capture these extra events- // .on_down(MouseButton::Left, |_, _, _| {})- // .on_up(MouseButton::Left, |_, _, _| {})- // .with_cursor_style(if has_click_action {- // CursorStyle::PointingHand- // } else {- // CursorStyle::Arrow- // })- // })- // .into_iter()- // })- // .into_any()- // }- // }}pub trait NotifyResultExt {diff --git a/crates/workspace/src/pane_group.rs b/crates/workspace/src/pane_group.rsindex 68fd3c084f5..e28d0e63ded 100644--- a/crates/workspace/src/pane_group.rs+++ b/crates/workspace/src/pane_group.rs@@ -12,7 +12,7 @@ use serde::Deserialize;use std::sync::Arc;use ui::{prelude::*, Button};-const HANDLE_HITBOX_SIZE: f32 = 10.0; //todo!(change this back to 4)+const HANDLE_HITBOX_SIZE: f32 = 4.0;const HORIZONTAL_MIN_SIZE: f32 = 80.;const VERTICAL_MIN_SIZE: f32 = 100.;@@ -707,7 +707,6 @@ mod element {proposed_current_pixel_change -= current_pixel_change;}- // todo!(schedule serialize)workspace.update(cx, |this, cx| this.schedule_serialize(cx)).log_err();diff --git a/crates/workspace/src/toolbar.rs b/crates/workspace/src/toolbar.rsindex dc17cd3c195..cc072b08b9e 100644--- a/crates/workspace/src/toolbar.rs+++ b/crates/workspace/src/toolbar.rs@@ -133,82 +133,6 @@ impl Render for Toolbar {}}-// todo!()-// impl View for Toolbar {-// fn ui_name() -> &'static str {-// "Toolbar"-// }--// fn render(&mut self, cx: &mut ViewContext<Self>) -> AnyElement<Self> {-// let theme = &theme::current(cx).workspace.toolbar;--// let mut primary_left_items = Vec::new();-// let mut primary_right_items = Vec::new();-// let mut secondary_item = None;-// let spacing = theme.item_spacing;-// let mut primary_items_row_count = 1;--// for (item, position) in &self.items {-// match *position {-// ToolbarItemLocation::Hidden => {}--// ToolbarItemLocation::PrimaryLeft { flex } => {-// primary_items_row_count = primary_items_row_count.max(item.row_count(cx));-// let left_item = ChildView::new(item.as_any(), cx).aligned();-// if let Some((flex, expanded)) = flex {-// primary_left_items.push(left_item.flex(flex, expanded).into_any());-// } else {-// primary_left_items.push(left_item.into_any());-// }-// }--// ToolbarItemLocation::PrimaryRight { flex } => {-// primary_items_row_count = primary_items_row_count.max(item.row_count(cx));-// let right_item = ChildView::new(item.as_any(), cx).aligned().flex_float();-// if let Some((flex, expanded)) = flex {-// primary_right_items.push(right_item.flex(flex, expanded).into_any());-// } else {-// primary_right_items.push(right_item.into_any());-// }-// }--// ToolbarItemLocation::Secondary => {-// secondary_item = Some(-// ChildView::new(item.as_any(), cx)-// .constrained()-// .with_height(theme.height * item.row_count(cx) as f32)-// .into_any(),-// );-// }-// }-// }--// let container_style = theme.container;-// let height = theme.height * primary_items_row_count as f32;--// let mut primary_items = Flex::row().with_spacing(spacing);-// primary_items.extend(primary_left_items);-// primary_items.extend(primary_right_items);--// let mut toolbar = Flex::column();-// if !primary_items.is_empty() {-// toolbar.add_child(primary_items.constrained().with_height(height));-// }-// if let Some(secondary_item) = secondary_item {-// toolbar.add_child(secondary_item);-// }--// if toolbar.is_empty() {-// toolbar.into_any_named("toolbar")-// } else {-// toolbar-// .contained()-// .with_style(container_style)-// .into_any_named("toolbar")-// }-// }-// }-impl Toolbar {pub fn new() -> Self {Self {@@ -312,10 +236,3 @@ impl<T: ToolbarItemView> ToolbarItemViewHandle for View<T> {self.read(cx).row_count(cx)}}--// todo!()-// impl From<&dyn ToolbarItemViewHandle> for AnyViewHandle {-// fn from(val: &dyn ToolbarItemViewHandle) -> Self {-// val.as_any().clone()-// }-// }diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rsindex ad02637ae39..739ce88636c 100644--- a/crates/workspace/src/workspace.rs+++ b/crates/workspace/src/workspace.rs@@ -943,10 +943,8 @@ impl Workspace {cx: &mut ViewContext<Workspace>,) -> Task<Result<()>> {let to_load = if let Some(pane) = pane.upgrade() {- // todo!("focus")- // cx.focus(&pane);-pane.update(cx, |pane, cx| {+ pane.focus(cx);loop {// Retrieve the weak item handle from the history.let entry = pane.nav_history_mut().pop(mode, cx)?;@@ -1631,8 +1629,7 @@ impl Workspace {});}- // todo!("focus")- // cx.focus_self();+ cx.focus_self();cx.notify();self.serialize_workspace(cx);}@@ -1713,6 +1710,7 @@ impl Workspace {cx.notify();}+ // todo!()// #[cfg(any(test, feature = "test-support"))]// pub fn zoomed_view(&self, cx: &AppContext) -> Option<AnyViewHandle> {// self.zoomed.and_then(|view| view.upgrade(cx))@@ -2992,7 +2990,6 @@ impl Workspace {cx.notify();}- #[allow(unused)]fn schedule_serialize(&mut self, cx: &mut ViewContext<Self>) {self._schedule_serialize = Some(cx.spawn(|this, mut cx| async move {cx.background_executor()diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rsindex 73368a98837..0b90961d235 100644--- a/crates/zed/src/zed.rs+++ b/crates/zed/src/zed.rs@@ -764,7 +764,6 @@ fn open_bundled_file(.detach_and_log_err(cx);}-// todo!()#[cfg(test)]mod tests {use super::*;