Remove last stale code

This commit is contained in:
Mikayla 2024-01-12 20:59:19 -08:00
parent 5897b18cfd
commit bfb59f1598
No known key found for this signature in database
9 changed files with 2 additions and 253 deletions

View File

@ -2043,7 +2043,7 @@ impl CollabPanel {
}),
)
.start_slot(
// todo!() handle contacts with no avatar
// todo handle contacts with no avatar
Avatar::new(contact.user.avatar_uri.clone())
.availability_indicator(if online { Some(!busy) } else { None }),
)

View File

@ -21,11 +21,6 @@ use crate::assets::Assets;
use crate::story_selector::{ComponentStory, StorySelector};
pub use indoc::indoc;
// gpui::actions! {
// storybook,
// [ToggleInspector]
// }
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
struct Args {

View File

@ -117,55 +117,5 @@ impl Render for IconButtonStory {
)
.children(vec![StorySection::new().children(buttons)])
.into_element()
// Story::container()
// .child(Story::title_for::<IconButton>())
// .child(Story::label("Default"))
// .child(div().w_8().child(IconButton::new("icon_a", Icon::Hash)))
// .child(Story::label("Selected"))
// .child(
// div()
// .w_8()
// .child(IconButton::new("icon_a", Icon::Hash).selected(true)),
// )
// .child(Story::label("Selected with `selected_icon`"))
// .child(
// div().w_8().child(
// IconButton::new("icon_a", Icon::AudioOn)
// .selected(true)
// .selected_icon(Icon::AudioOff),
// ),
// )
// .child(Story::label("Disabled"))
// .child(
// div()
// .w_8()
// .child(IconButton::new("icon_a", Icon::Hash).disabled(true)),
// )
// .child(Story::label("With `on_click`"))
// .child(
// div()
// .w_8()
// .child(
// IconButton::new("with_on_click", Icon::Ai).on_click(|_event, _cx| {
// println!("Clicked!");
// }),
// ),
// )
// .child(Story::label("With `tooltip`"))
// .child(
// div().w_8().child(
// IconButton::new("with_tooltip", Icon::MessageBubbles)
// .tooltip(|cx| Tooltip::text("Open messages", cx)),
// ),
// )
// .child(Story::label("Selected with `tooltip`"))
// .child(
// div().w_8().child(
// IconButton::new("selected_with_tooltip", Icon::InlayHint)
// .selected(true)
// .tooltip(|cx| Tooltip::text("Toggle inlay hints", cx)),
// ),
// )
}
}

View File

@ -809,27 +809,6 @@ pub mod test {
Edit,
}
// impl Clone for TestItem {
// fn clone(&self) -> Self {
// Self {
// state: self.state.clone(),
// label: self.label.clone(),
// save_count: self.save_count,
// save_as_count: self.save_as_count,
// reload_count: self.reload_count,
// is_dirty: self.is_dirty,
// is_singleton: self.is_singleton,
// has_conflict: self.has_conflict,
// project_items: self.project_items.clone(),
// nav_history: None,
// tab_descriptions: None,
// tab_detail: Default::default(),
// workspace_id: self.workspace_id,
// focus_handle: self.focus_handle.clone(),
// }
// }
// }
impl TestProjectItem {
pub fn new(id: u64, path: &str, cx: &mut AppContext) -> Model<Self> {
let entry_id = Some(ProjectEntryId::from_proto(id));

View File

@ -60,24 +60,6 @@ pub enum SaveIntent {
#[derive(Clone, Deserialize, PartialEq, Debug)]
pub struct ActivateItem(pub usize);
// #[derive(Clone, PartialEq)]
// pub struct CloseItemById {
// pub item_id: usize,
// pub pane: WeakView<Pane>,
// }
// #[derive(Clone, PartialEq)]
// pub struct CloseItemsToTheLeftById {
// pub item_id: usize,
// pub pane: WeakView<Pane>,
// }
// #[derive(Clone, PartialEq)]
// pub struct CloseItemsToTheRightById {
// pub item_id: usize,
// pub pane: WeakView<Pane>,
// }
#[derive(Clone, PartialEq, Debug, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CloseActiveItem {
@ -1226,125 +1208,6 @@ impl Pane {
cx.emit(Event::Split(direction));
}
// fn deploy_split_menu(&mut self, cx: &mut ViewContext<Self>) {
// self.tab_bar_context_menu.handle.update(cx, |menu, cx| {
// menu.toggle(
// Default::default(),
// AnchorCorner::TopRight,
// vec![
// ContextMenuItem::action("Split Right", SplitRight),
// ContextMenuItem::action("Split Left", SplitLeft),
// ContextMenuItem::action("Split Up", SplitUp),
// ContextMenuItem::action("Split Down", SplitDown),
// ],
// cx,
// );
// });
// self.tab_bar_context_menu.kind = TabBarContextMenuKind::Split;
// }
// fn deploy_new_menu(&mut self, cx: &mut ViewContext<Self>) {
// self.tab_bar_context_menu.handle.update(cx, |menu, cx| {
// menu.toggle(
// Default::default(),
// AnchorCorner::TopRight,
// vec![
// ContextMenuItem::action("New File", NewFile),
// ContextMenuItem::action("New Terminal", NewCenterTerminal),
// ContextMenuItem::action("New Search", NewSearch),
// ],
// cx,
// );
// });
// self.tab_bar_context_menu.kind = TabBarContextMenuKind::New;
// }
// fn deploy_tab_context_menu(
// &mut self,
// position: Vector2F,
// target_item_id: usize,
// cx: &mut ViewContext<Self>,
// ) {
// let active_item_id = self.items[self.active_item_index].id();
// let is_active_item = target_item_id == active_item_id;
// let target_pane = cx.weak_handle();
// // The `CloseInactiveItems` action should really be called "CloseOthers" and the behaviour should be dynamically based on the tab the action is ran on. Currently, this is a weird action because you can run it on a non-active tab and it will close everything by the actual active tab
// self.tab_context_menu.update(cx, |menu, cx| {
// menu.show(
// position,
// AnchorCorner::TopLeft,
// if is_active_item {
// vec![
// ContextMenuItem::action(
// "Close Active Item",
// CloseActiveItem { save_intent: None },
// ),
// ContextMenuItem::action("Close Inactive Items", CloseInactiveItems),
// ContextMenuItem::action("Close Clean Items", CloseCleanItems),
// ContextMenuItem::action("Close Items To The Left", CloseItemsToTheLeft),
// ContextMenuItem::action("Close Items To The Right", CloseItemsToTheRight),
// ContextMenuItem::action(
// "Close All Items",
// CloseAllItems { save_intent: None },
// ),
// ]
// } else {
// // In the case of the user right clicking on a non-active tab, for some item-closing commands, we need to provide the id of the tab, for the others, we can reuse the existing command.
// vec![
// ContextMenuItem::handler("Close Inactive Item", {
// let pane = target_pane.clone();
// move |cx| {
// if let Some(pane) = pane.upgrade(cx) {
// pane.update(cx, |pane, cx| {
// pane.close_item_by_id(
// target_item_id,
// SaveIntent::Close,
// cx,
// )
// .detach_and_log_err(cx);
// })
// }
// }
// }),
// ContextMenuItem::action("Close Inactive Items", CloseInactiveItems),
// ContextMenuItem::action("Close Clean Items", CloseCleanItems),
// ContextMenuItem::handler("Close Items To The Left", {
// let pane = target_pane.clone();
// move |cx| {
// if let Some(pane) = pane.upgrade(cx) {
// pane.update(cx, |pane, cx| {
// pane.close_items_to_the_left_by_id(target_item_id, cx)
// .detach_and_log_err(cx);
// })
// }
// }
// }),
// ContextMenuItem::handler("Close Items To The Right", {
// let pane = target_pane.clone();
// move |cx| {
// if let Some(pane) = pane.upgrade(cx) {
// pane.update(cx, |pane, cx| {
// pane.close_items_to_the_right_by_id(target_item_id, cx)
// .detach_and_log_err(cx);
// })
// }
// }
// }),
// ContextMenuItem::action(
// "Close All Items",
// CloseAllItems { save_intent: None },
// ),
// ]
// },
// cx,
// );
// });
// }
pub fn toolbar(&self) -> &View<Toolbar> {
&self.toolbar
}

View File

@ -1,5 +1,3 @@
//#![allow(dead_code)]
pub mod model;
use std::path::Path;

View File

@ -3324,36 +3324,6 @@ impl Workspace {
workspace
}
// fn render_dock(&self, position: DockPosition, cx: &WindowContext) -> Option<AnyElement<Self>> {
// let dock = match position {
// DockPosition::Left => &self.left_dock,
// DockPosition::Right => &self.right_dock,
// DockPosition::Bottom => &self.bottom_dock,
// };
// let active_panel = dock.read(cx).visible_panel()?;
// let element = if Some(active_panel.id()) == self.zoomed.as_ref().map(|zoomed| zoomed.id()) {
// dock.read(cx).render_placeholder(cx)
// } else {
// ChildView::new(dock, cx).into_any()
// };
// Some(
// element
// .constrained()
// .dynamically(move |constraint, _, cx| match position {
// DockPosition::Left | DockPosition::Right => SizeConstraint::new(
// Vector2F::new(20., constraint.min.y()),
// Vector2F::new(cx.window_size().x() * 0.8, constraint.max.y()),
// ),
// DockPosition::Bottom => SizeConstraint::new(
// Vector2F::new(constraint.min.x(), 20.),
// Vector2F::new(constraint.max.x(), cx.window_size().y() * 0.8),
// ),
// })
// .into_any(),
// )
// }
// }
pub fn register_action<A: Action>(
&mut self,
callback: impl Fn(&mut Self, &A, &mut ViewContext<Self>) + 'static,

View File

@ -184,7 +184,7 @@ mod tests {
#[gpui::test]
async fn test_python_autoindent(cx: &mut TestAppContext) {
// cx.executor().set_block_on_ticks(usize::MAX..=usize::MAX);
cx.executor().set_block_on_ticks(usize::MAX..=usize::MAX);
let language =
crate::languages::language("python", tree_sitter_python::language(), None).await;
cx.update(|cx| {

View File

@ -113,12 +113,6 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
})
.detach();
// cx.emit(workspace::Event::PaneAdded(workspace.active_pane().clone()));
// let collab_titlebar_item =
// cx.add_view(|cx| CollabTitlebarItem::new(workspace, &workspace_handle, cx));
// workspace.set_titlebar_item(collab_titlebar_item.into_any(), cx);
let copilot = cx.new_view(|cx| copilot_ui::CopilotButton::new(app_state.fs.clone(), cx));
let diagnostic_summary =
cx.new_view(|cx| diagnostics::items::DiagnosticIndicator::new(workspace, cx));