Detailed changes
@@ -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)
}
@@ -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!())
}
}
```
@@ -203,7 +203,6 @@ macro_rules! __impl_action {
)
}
- // todo!() why is this needed in addition to name?
fn debug_name() -> &'static str
where
Self: ::std::marker::Sized
@@ -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();
}
})
.await
@@ -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,
}
@@ -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> {
@@ -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()
@@ -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 str
where
Self: Sized,
{
- todo!()
+ unimplemented!()
}
fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>
where
Self: Sized,
{
- todo!()
+ unimplemented!()
}
}
}
@@ -258,19 +258,19 @@ fn test_typing_multiple_new_injections() {
let (buffer, syntax_map) = test_edit_sequence(
"Rust",
&[
- "fn a() { dbg }",
- "fn a() { dbg«!» }",
- "fn a() { dbg!«()» }",
- "fn a() { dbg!(«b») }",
- "fn a() { dbg!(b«.») }",
- "fn a() { dbg!(b.«c») }",
- "fn a() { dbg!(b.c«()») }",
- "fn a() { dbg!(b.c(«vec»)) }",
- "fn a() { dbg!(b.c(vec«!»)) }",
- "fn a() { dbg!(b.c(vec!«[]»)) }",
- "fn a() { dbg!(b.c(vec![«d»])) }",
- "fn a() { dbg!(b.c(vec![d«.»])) }",
- "fn a() { dbg!(b.c(vec![d.«e»])) }",
+ "fn a() { test_macro }",
+ "fn a() { test_macro«!» }",
+ "fn a() { test_macro!«()» }",
+ "fn a() { test_macro!(«b») }",
+ "fn a() { test_macro!(b«.») }",
+ "fn a() { test_macro!(b.«c») }",
+ "fn a() { test_macro!(b.c«()») }",
+ "fn a() { test_macro!(b.c(«vec»)) }",
+ "fn a() { test_macro!(b.c(vec«!»)) }",
+ "fn a() { test_macro!(b.c(vec!«[]»)) }",
+ "fn a() { test_macro!(b.c(vec![«d»])) }",
+ "fn a() { test_macro!(b.c(vec![d«.»])) }",
+ "fn a() { test_macro!(b.c(vec![d.«e»])) }",
],
);
@@ -278,7 +278,7 @@ fn test_typing_multiple_new_injections() {
&syntax_map,
&buffer,
&["field"],
- "fn a() { dbg!(b.«c»(vec![d.«e»])) }",
+ "fn a() { test_macro!(b.«c»(vec![d.«e»])) }",
);
}
@@ -395,7 +395,6 @@ impl Dock {
})
.ok();
}
- // todo!() we do not use this event in the production code (even in zed1), remove it
PanelEvent::Activate => {
if let Some(ix) = this
.panel_entries
@@ -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 {
@@ -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();
@@ -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()
-// }
-// }
@@ -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()
@@ -764,7 +764,6 @@ fn open_bundled_file(
.detach_and_log_err(cx);
}
-// todo!()
#[cfg(test)]
mod tests {
use super::*;