diff --git a/crates/assistant/src/slash_command/tab_command.rs b/crates/assistant/src/slash_command/tab_command.rs index b6e38f2e479d5..adcb8398be0a4 100644 --- a/crates/assistant/src/slash_command/tab_command.rs +++ b/crates/assistant/src/slash_command/tab_command.rs @@ -281,7 +281,7 @@ fn tab_items_for_queries( fn active_item_buffer( workspace: &mut Workspace, - cx: &mut ui::ViewContext, + cx: &mut ViewContext, ) -> anyhow::Result { let active_editor = workspace .active_item(cx) diff --git a/crates/auto_update_ui/src/update_notification.rs b/crates/auto_update_ui/src/update_notification.rs index 7568a0eb1a94e..33ac333a30269 100644 --- a/crates/auto_update_ui/src/update_notification.rs +++ b/crates/auto_update_ui/src/update_notification.rs @@ -18,7 +18,7 @@ pub struct UpdateNotification { impl EventEmitter for UpdateNotification {} impl Render for UpdateNotification { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { let app_name = ReleaseChannel::global(cx).display_name(); v_flex() diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rs index 75055247cbafd..4e6d8940b6d24 100644 --- a/crates/collab_ui/src/chat_panel.rs +++ b/crates/collab_ui/src/chat_panel.rs @@ -1096,7 +1096,7 @@ impl FocusableView for ChatPanel { } impl Panel for ChatPanel { - fn position(&self, cx: &gpui::WindowContext) -> DockPosition { + fn position(&self, cx: &WindowContext) -> DockPosition { ChatPanelSettings::get_global(cx).dock } @@ -1112,7 +1112,7 @@ impl Panel for ChatPanel { ); } - fn size(&self, cx: &gpui::WindowContext) -> Pixels { + fn size(&self, cx: &WindowContext) -> Pixels { self.width .unwrap_or_else(|| ChatPanelSettings::get_global(cx).default_width) } diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index f5e345043dacb..1f60f65b41839 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -2719,7 +2719,7 @@ impl Render for CollabPanel { impl EventEmitter for CollabPanel {} impl Panel for CollabPanel { - fn position(&self, cx: &gpui::WindowContext) -> DockPosition { + fn position(&self, cx: &WindowContext) -> DockPosition { CollaborationPanelSettings::get_global(cx).dock } @@ -2735,7 +2735,7 @@ impl Panel for CollabPanel { ); } - fn size(&self, cx: &gpui::WindowContext) -> Pixels { + fn size(&self, cx: &WindowContext) -> Pixels { self.width .unwrap_or_else(|| CollaborationPanelSettings::get_global(cx).default_width) } @@ -2746,7 +2746,7 @@ impl Panel for CollabPanel { cx.notify(); } - fn icon(&self, cx: &gpui::WindowContext) -> Option { + fn icon(&self, cx: &WindowContext) -> Option { CollaborationPanelSettings::get_global(cx) .button .then_some(ui::IconName::UserGroup) diff --git a/crates/collab_ui/src/notification_panel.rs b/crates/collab_ui/src/notification_panel.rs index 410b90c7271bb..005220471a16c 100644 --- a/crates/collab_ui/src/notification_panel.rs +++ b/crates/collab_ui/src/notification_panel.rs @@ -662,7 +662,7 @@ impl Panel for NotificationPanel { "NotificationPanel" } - fn position(&self, cx: &gpui::WindowContext) -> DockPosition { + fn position(&self, cx: &WindowContext) -> DockPosition { NotificationPanelSettings::get_global(cx).dock } @@ -678,7 +678,7 @@ impl Panel for NotificationPanel { ); } - fn size(&self, cx: &gpui::WindowContext) -> Pixels { + fn size(&self, cx: &WindowContext) -> Pixels { self.width .unwrap_or_else(|| NotificationPanelSettings::get_global(cx).default_width) } @@ -702,7 +702,7 @@ impl Panel for NotificationPanel { } } - fn icon(&self, cx: &gpui::WindowContext) -> Option { + fn icon(&self, cx: &WindowContext) -> Option { let show_button = NotificationPanelSettings::get_global(cx).button; if !show_button { return None; diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 208971763db3a..4dca33e3ada1f 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -1199,7 +1199,7 @@ impl Panel for GitPanel { "GitPanel" } - fn position(&self, cx: &gpui::WindowContext) -> DockPosition { + fn position(&self, cx: &WindowContext) -> DockPosition { GitPanelSettings::get_global(cx).dock } @@ -1215,7 +1215,7 @@ impl Panel for GitPanel { ); } - fn size(&self, cx: &gpui::WindowContext) -> Pixels { + fn size(&self, cx: &WindowContext) -> Pixels { self.width .unwrap_or_else(|| GitPanelSettings::get_global(cx).default_width) } diff --git a/crates/gpui/src/elements/animation.rs b/crates/gpui/src/elements/animation.rs index bffa52cfbafb7..2cab9e8fa46ae 100644 --- a/crates/gpui/src/elements/animation.rs +++ b/crates/gpui/src/elements/animation.rs @@ -1,6 +1,6 @@ use std::time::{Duration, Instant}; -use crate::{AnyElement, Element, ElementId, GlobalElementId, IntoElement}; +use crate::{AnyElement, Element, ElementId, GlobalElementId, IntoElement, WindowContext}; pub use easing::*; @@ -104,7 +104,7 @@ impl Element for AnimationElement { fn request_layout( &mut self, global_id: Option<&GlobalElementId>, - cx: &mut crate::WindowContext, + cx: &mut WindowContext, ) -> (crate::LayoutId, Self::RequestLayoutState) { cx.with_element_state(global_id.unwrap(), |state, cx| { let state = state.unwrap_or_else(|| AnimationState { @@ -145,7 +145,7 @@ impl Element for AnimationElement { _id: Option<&GlobalElementId>, _bounds: crate::Bounds, element: &mut Self::RequestLayoutState, - cx: &mut crate::WindowContext, + cx: &mut WindowContext, ) -> Self::PrepaintState { element.prepaint(cx); } @@ -156,7 +156,7 @@ impl Element for AnimationElement { _bounds: crate::Bounds, element: &mut Self::RequestLayoutState, _: &mut Self::PrepaintState, - cx: &mut crate::WindowContext, + cx: &mut WindowContext, ) { element.paint(cx); } diff --git a/crates/gpui/src/elements/list.rs b/crates/gpui/src/elements/list.rs index 47f0a82774eb0..e652f303735aa 100644 --- a/crates/gpui/src/elements/list.rs +++ b/crates/gpui/src/elements/list.rs @@ -716,7 +716,7 @@ impl Element for List { fn request_layout( &mut self, _id: Option<&GlobalElementId>, - cx: &mut crate::WindowContext, + cx: &mut WindowContext, ) -> (crate::LayoutId, Self::RequestLayoutState) { let layout_id = match self.sizing_behavior { ListSizingBehavior::Infer => { @@ -827,7 +827,7 @@ impl Element for List { bounds: Bounds, _: &mut Self::RequestLayoutState, prepaint: &mut Self::PrepaintState, - cx: &mut crate::WindowContext, + cx: &mut WindowContext, ) { cx.with_content_mask(Some(ContentMask { bounds }), |cx| { for item in &mut prepaint.layout.item_layouts { diff --git a/crates/gpui/src/interactive.rs b/crates/gpui/src/interactive.rs index daa9b30877ca5..a6cff28ffbe0e 100644 --- a/crates/gpui/src/interactive.rs +++ b/crates/gpui/src/interactive.rs @@ -468,7 +468,7 @@ mod test { use crate::{ self as gpui, div, FocusHandle, InteractiveElement, IntoElement, KeyBinding, Keystroke, - ParentElement, Render, TestAppContext, VisualContext, + ParentElement, Render, TestAppContext, ViewContext, VisualContext, }; struct TestView { @@ -480,7 +480,7 @@ mod test { actions!(test, [TestAction]); impl Render for TestView { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { div().id("testview").child( div() .key_context("parent") diff --git a/crates/gpui_macros/src/derive_render.rs b/crates/gpui_macros/src/derive_render.rs index 2b39248f80872..e76466fd107b7 100644 --- a/crates/gpui_macros/src/derive_render.rs +++ b/crates/gpui_macros/src/derive_render.rs @@ -11,7 +11,7 @@ pub fn derive_render(input: TokenStream) -> TokenStream { impl #impl_generics gpui::Render for #type_name #type_generics #where_clause { - fn render(&mut self, _cx: &mut gpui::ViewContext) -> impl gpui::Element { + fn render(&mut self, _cx: &mut ViewContext) -> impl gpui::Element { gpui::Empty } } diff --git a/crates/language_tools/src/syntax_tree_view.rs b/crates/language_tools/src/syntax_tree_view.rs index f96dc6a87fb7f..ba40d55761fec 100644 --- a/crates/language_tools/src/syntax_tree_view.rs +++ b/crates/language_tools/src/syntax_tree_view.rs @@ -273,7 +273,7 @@ impl SyntaxTreeView { } impl Render for SyntaxTreeView { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { let mut rendered = div().flex_1(); if let Some(layer) = self diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 39f1c8a543e06..483d64d8eb7bd 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -3810,7 +3810,7 @@ fn item_width_estimate(depth: usize, item_text_chars: usize, is_symlink: bool) - } impl Render for ProjectPanel { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { let has_worktree = !self.visible_entries.is_empty(); let project = self.project.read(cx); let indent_size = ProjectPanelSettings::get_global(cx).indent_size; diff --git a/crates/recent_projects/src/ssh_connections.rs b/crates/recent_projects/src/ssh_connections.rs index 1c084bbf6e97b..ad8985d20f050 100644 --- a/crates/recent_projects/src/ssh_connections.rs +++ b/crates/recent_projects/src/ssh_connections.rs @@ -357,7 +357,7 @@ impl RenderOnce for SshConnectionHeader { } impl Render for SshConnectionModal { - fn render(&mut self, cx: &mut ui::ViewContext) -> impl ui::IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl ui::IntoElement { let nickname = self.prompt.read(cx).nickname.clone(); let connection_string = self.prompt.read(cx).connection_string.clone(); diff --git a/crates/semantic_index/src/project_index_debug_view.rs b/crates/semantic_index/src/project_index_debug_view.rs index 4f59290f021eb..80563bcffa877 100644 --- a/crates/semantic_index/src/project_index_debug_view.rs +++ b/crates/semantic_index/src/project_index_debug_view.rs @@ -196,7 +196,7 @@ impl ProjectIndexDebugView { } impl Render for ProjectIndexDebugView { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { if let Some(selected_path) = self.selected_path.as_ref() { v_flex() .child( diff --git a/crates/storybook/src/stories/focus.rs b/crates/storybook/src/stories/focus.rs index 4240aa6fd19c9..9eb715dbd9133 100644 --- a/crates/storybook/src/stories/focus.rs +++ b/crates/storybook/src/stories/focus.rs @@ -56,7 +56,7 @@ impl FocusStory { } impl Render for FocusStory { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { let theme = cx.theme(); let color_1 = theme.status().created; let color_2 = theme.status().modified; diff --git a/crates/storybook/src/stories/picker.rs b/crates/storybook/src/stories/picker.rs index 5df6cc23c4199..19c115a6b2427 100644 --- a/crates/storybook/src/stories/picker.rs +++ b/crates/storybook/src/stories/picker.rs @@ -45,7 +45,7 @@ impl PickerDelegate for Delegate { &self, ix: usize, selected: bool, - _cx: &mut gpui::ViewContext>, + _cx: &mut ViewContext>, ) -> Option { let candidate_ix = self.matches.get(ix)?; // TASK: Make StringMatchCandidate::string a SharedString @@ -64,12 +64,12 @@ impl PickerDelegate for Delegate { self.selected_ix } - fn set_selected_index(&mut self, ix: usize, cx: &mut gpui::ViewContext>) { + fn set_selected_index(&mut self, ix: usize, cx: &mut ViewContext>) { self.selected_ix = ix; cx.notify(); } - fn confirm(&mut self, secondary: bool, _cx: &mut gpui::ViewContext>) { + fn confirm(&mut self, secondary: bool, _cx: &mut ViewContext>) { let candidate_ix = self.matches[self.selected_ix]; let candidate = self.candidates[candidate_ix].string.clone(); @@ -80,15 +80,11 @@ impl PickerDelegate for Delegate { } } - fn dismissed(&mut self, cx: &mut gpui::ViewContext>) { + fn dismissed(&mut self, cx: &mut ViewContext>) { cx.quit(); } - fn update_matches( - &mut self, - query: String, - cx: &mut gpui::ViewContext>, - ) -> Task<()> { + fn update_matches(&mut self, query: String, cx: &mut ViewContext>) -> Task<()> { let candidates = self.candidates.clone(); self.matches = cx .background_executor() @@ -194,7 +190,7 @@ impl PickerStory { } impl Render for PickerStory { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { div() .bg(cx.theme().styles.colors.background) .size_full() diff --git a/crates/storybook/src/stories/scroll.rs b/crates/storybook/src/stories/scroll.rs index 096afaccf6f88..ace2b4811feec 100644 --- a/crates/storybook/src/stories/scroll.rs +++ b/crates/storybook/src/stories/scroll.rs @@ -11,7 +11,7 @@ impl ScrollStory { } impl Render for ScrollStory { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { let theme = cx.theme(); let color_1 = theme.status().created; let color_2 = theme.status().modified; diff --git a/crates/storybook/src/stories/text.rs b/crates/storybook/src/stories/text.rs index 6c37b88ee6d40..8aa0ea701b740 100644 --- a/crates/storybook/src/stories/text.rs +++ b/crates/storybook/src/stories/text.rs @@ -1,6 +1,6 @@ use gpui::{ div, green, red, HighlightStyle, InteractiveText, IntoElement, ParentElement, Render, Styled, - StyledText, View, VisualContext, WindowContext, + StyledText, View, ViewContext, VisualContext, WindowContext, }; use indoc::indoc; use story::*; @@ -14,7 +14,7 @@ impl TextStory { } impl Render for TextStory { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { Story::container() .child(Story::title("Text")) .children(vec![ diff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rs index ee3fbd8f39abe..1ca5b7adb14be 100644 --- a/crates/terminal_view/src/terminal_view.rs +++ b/crates/terminal_view/src/terminal_view.rs @@ -420,7 +420,7 @@ impl TerminalView { cx.notify(); } - pub fn should_show_cursor(&self, focused: bool, cx: &mut gpui::ViewContext) -> bool { + pub fn should_show_cursor(&self, focused: bool, cx: &mut ViewContext) -> bool { //Don't blink the cursor when not focused, blinking is disabled, or paused if !focused || self.blinking_paused diff --git a/crates/welcome/src/base_keymap_picker.rs b/crates/welcome/src/base_keymap_picker.rs index 0d546ebed2566..fcffef91aa721 100644 --- a/crates/welcome/src/base_keymap_picker.rs +++ b/crates/welcome/src/base_keymap_picker.rs @@ -194,7 +194,7 @@ impl PickerDelegate for BaseKeymapSelectorDelegate { &self, ix: usize, selected: bool, - _cx: &mut gpui::ViewContext>, + _cx: &mut ViewContext>, ) -> Option { let keymap_match = &self.matches[ix]; diff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rs index 7a0b5711b78f1..6264f72a121f2 100644 --- a/crates/welcome/src/welcome.rs +++ b/crates/welcome/src/welcome.rs @@ -69,7 +69,7 @@ pub struct WelcomePage { } impl Render for WelcomePage { - fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { + fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { h_flex() .size_full() .bg(cx.theme().colors().editor_background) diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rs index fa69c9aa6127e..46201de2a3b0f 100644 --- a/crates/workspace/src/dock.rs +++ b/crates/workspace/src/dock.rs @@ -844,7 +844,7 @@ pub mod test { "TestPanel" } - fn position(&self, _: &gpui::WindowContext) -> super::DockPosition { + fn position(&self, _: &WindowContext) -> super::DockPosition { self.position } diff --git a/crates/workspace/src/item.rs b/crates/workspace/src/item.rs index 2808bd498f1ea..3a3a61b319a10 100644 --- a/crates/workspace/src/item.rs +++ b/crates/workspace/src/item.rs @@ -1239,11 +1239,7 @@ pub mod test { None } - fn tab_content( - &self, - params: TabContentParams, - _cx: &ui::prelude::WindowContext, - ) -> AnyElement { + fn tab_content(&self, params: TabContentParams, _cx: &WindowContext) -> AnyElement { self.tab_detail.set(params.detail); gpui::div().into_any_element() } diff --git a/crates/workspace/src/pane_group.rs b/crates/workspace/src/pane_group.rs index 722c48f0585ae..168f6539e0100 100644 --- a/crates/workspace/src/pane_group.rs +++ b/crates/workspace/src/pane_group.rs @@ -1018,7 +1018,7 @@ mod element { fn request_layout( &mut self, _global_id: Option<&GlobalElementId>, - cx: &mut ui::prelude::WindowContext, + cx: &mut WindowContext, ) -> (gpui::LayoutId, Self::RequestLayoutState) { let style = Style { flex_grow: 1., @@ -1119,7 +1119,7 @@ mod element { bounds: gpui::Bounds, _: &mut Self::RequestLayoutState, layout: &mut Self::PrepaintState, - cx: &mut ui::prelude::WindowContext, + cx: &mut WindowContext, ) { for child in &mut layout.children { child.element.paint(cx); diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 284980bf50d2e..b6795cda1428b 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -695,7 +695,7 @@ fn initialize_pane(workspace: &Workspace, pane: &View, cx: &mut ViewContex }); } -fn about(_: &mut Workspace, _: &zed_actions::About, cx: &mut gpui::ViewContext) { +fn about(_: &mut Workspace, _: &zed_actions::About, cx: &mut ViewContext) { let release_channel = ReleaseChannel::global(cx).display_name(); let version = env!("CARGO_PKG_VERSION"); let message = format!("{release_channel} {version}");