diff --git a/Cargo.lock b/Cargo.lock index 9a06b71f70ae1..eac03792799b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2928,7 +2928,6 @@ dependencies = [ "serde_json", "settings", "smol", - "ui", "url", "util", "workspace", diff --git a/crates/assistant/src/slash_command/auto_command.rs b/crates/assistant/src/slash_command/auto_command.rs index 61f720be6d991..c72b909010cf1 100644 --- a/crates/assistant/src/slash_command/auto_command.rs +++ b/crates/assistant/src/slash_command/auto_command.rs @@ -5,7 +5,7 @@ use assistant_slash_command::{ }; use feature_flags::FeatureFlag; use futures::StreamExt; -use gpui::{AppContext, AsyncAppContext, Task, WeakView}; +use gpui::{AppContext, AsyncAppContext, AsyncWindowContext, Task, WeakView, WindowContext}; use language::{CodeLabel, LspAdapterDelegate}; use language_model::{ LanguageModelCompletionEvent, LanguageModelRegistry, LanguageModelRequest, @@ -14,7 +14,7 @@ use language_model::{ use semantic_index::{FileSummary, SemanticDb}; use smol::channel; use std::sync::{atomic::AtomicBool, Arc}; -use ui::{prelude::*, BorrowAppContext, WindowContext}; +use ui::{prelude::*, BorrowAppContext}; use util::ResultExt; use workspace::Workspace; @@ -115,7 +115,7 @@ impl SlashCommand for AutoCommand { return Task::ready(Err(anyhow!("no project indexer"))); }; - let task = cx.spawn(|cx: gpui::AsyncWindowContext| async move { + let task = cx.spawn(|cx: AsyncWindowContext| async move { let summaries = project_index .read_with(&cx, |project_index, cx| project_index.all_summaries(cx))? .await?; diff --git a/crates/assistant2/src/context_picker/fetch_context_picker.rs b/crates/assistant2/src/context_picker/fetch_context_picker.rs index 2d28e515ec45b..45a0575911d64 100644 --- a/crates/assistant2/src/context_picker/fetch_context_picker.rs +++ b/crates/assistant2/src/context_picker/fetch_context_picker.rs @@ -176,7 +176,7 @@ impl PickerDelegate for FetchContextPickerDelegate { fn set_selected_index(&mut self, _ix: usize, _cx: &mut ViewContext>) {} - fn placeholder_text(&self, _cx: &mut ui::WindowContext) -> Arc { + fn placeholder_text(&self, _cx: &mut WindowContext) -> Arc { "Enter a URL…".into() } diff --git a/crates/context_server/Cargo.toml b/crates/context_server/Cargo.toml index 410b897f2859d..e264bff2f4bf7 100644 --- a/crates/context_server/Cargo.toml +++ b/crates/context_server/Cargo.toml @@ -28,7 +28,6 @@ serde.workspace = true serde_json.workspace = true settings.workspace = true smol.workspace = true -ui.workspace = true url = { workspace = true, features = ["serde"] } util.workspace = true workspace.workspace = true diff --git a/crates/context_server/src/context_server_tool.rs b/crates/context_server/src/context_server_tool.rs index 70740f710ac03..161b61b22f23e 100644 --- a/crates/context_server/src/context_server_tool.rs +++ b/crates/context_server/src/context_server_tool.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use anyhow::{anyhow, bail}; use assistant_tool::Tool; -use gpui::{Model, Task}; +use gpui::{Model, Task, WindowContext}; use crate::manager::ContextServerManager; use crate::types; @@ -52,7 +52,7 @@ impl Tool for ContextServerTool { self: std::sync::Arc, input: serde_json::Value, _workspace: gpui::WeakView, - cx: &mut ui::WindowContext, + cx: &mut WindowContext, ) -> gpui::Task> { if let Some(server) = self.server_manager.read(cx).get_server(&self.server_id) { cx.foreground_executor().spawn({ diff --git a/crates/editor/src/proposed_changes_editor.rs b/crates/editor/src/proposed_changes_editor.rs index f4934c32b0abc..923dcc24b9f04 100644 --- a/crates/editor/src/proposed_changes_editor.rs +++ b/crates/editor/src/proposed_changes_editor.rs @@ -288,7 +288,7 @@ impl EventEmitter for ProposedChangesEditor {} impl Item for ProposedChangesEditor { type Event = EditorEvent; - fn tab_icon(&self, _cx: &ui::WindowContext) -> Option { + fn tab_icon(&self, _cx: &WindowContext) -> Option { Some(Icon::new(IconName::Diff)) } diff --git a/crates/editor/src/scroll/actions.rs b/crates/editor/src/scroll/actions.rs index eb49ac6219093..df6f4c67cdeaa 100644 --- a/crates/editor/src/scroll/actions.rs +++ b/crates/editor/src/scroll/actions.rs @@ -4,7 +4,7 @@ use crate::{ ScrollAnchor, ScrollCursorBottom, ScrollCursorCenter, ScrollCursorCenterTopBottom, ScrollCursorTop, SCROLL_CENTER_TOP_BOTTOM_DEBOUNCE_TIMEOUT, }; -use gpui::{Point, ViewContext}; +use gpui::{AsyncWindowContext, Point, ViewContext}; impl Editor { pub fn next_screen(&mut self, _: &NextScreen, cx: &mut ViewContext) { @@ -75,7 +75,7 @@ impl Editor { self.next_scroll_position = self.next_scroll_position.next(); self._scroll_cursor_center_top_bottom_task = - cx.spawn(|editor, mut cx: gpui::AsyncWindowContext| async move { + cx.spawn(|editor, mut cx: AsyncWindowContext| async move { cx.background_executor() .timer(SCROLL_CENTER_TOP_BOTTOM_DEBOUNCE_TIMEOUT) .await; diff --git a/crates/feedback/src/system_specs.rs b/crates/feedback/src/system_specs.rs index a5701801871b8..c367fe609f4ed 100644 --- a/crates/feedback/src/system_specs.rs +++ b/crates/feedback/src/system_specs.rs @@ -1,11 +1,10 @@ use client::telemetry; -use gpui::Task; +use gpui::{Task, WindowContext}; use human_bytes::human_bytes; use release_channel::{AppCommitSha, AppVersion, ReleaseChannel}; use serde::Serialize; use std::{env, fmt::Display}; use sysinfo::{MemoryRefreshKind, RefreshKind, System}; -use ui::WindowContext; #[derive(Clone, Debug, Serialize)] pub struct SystemSpecs { diff --git a/crates/language_model/src/fake_provider.rs b/crates/language_model/src/fake_provider.rs index 2044ae520db61..bf240b4bda793 100644 --- a/crates/language_model/src/fake_provider.rs +++ b/crates/language_model/src/fake_provider.rs @@ -4,12 +4,11 @@ use crate::{ LanguageModelProviderState, LanguageModelRequest, }; use futures::{channel::mpsc, future::BoxFuture, stream::BoxStream, FutureExt, StreamExt}; -use gpui::{AnyView, AppContext, AsyncAppContext, Task}; +use gpui::{AnyView, AppContext, AsyncAppContext, Model, Task, WindowContext}; use http_client::Result; use parking_lot::Mutex; use serde::Serialize; use std::sync::Arc; -use ui::WindowContext; pub fn language_model_id() -> LanguageModelId { LanguageModelId::from("fake".to_string()) @@ -33,7 +32,7 @@ pub struct FakeLanguageModelProvider; impl LanguageModelProviderState for FakeLanguageModelProvider { type ObservableEntity = (); - fn observable_entity(&self) -> Option> { + fn observable_entity(&self) -> Option> { None } } diff --git a/crates/repl/src/notebook/notebook_ui.rs b/crates/repl/src/notebook/notebook_ui.rs index 395d1d59d8367..84455d0ccf535 100644 --- a/crates/repl/src/notebook/notebook_ui.rs +++ b/crates/repl/src/notebook/notebook_ui.rs @@ -673,7 +673,7 @@ impl Item for NotebookEditor { .into_any_element() } - fn tab_icon(&self, _cx: &ui::WindowContext) -> Option { + fn tab_icon(&self, _cx: &WindowContext) -> Option { Some(IconName::Book.into()) } diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rs index 660a2a161fdc2..632835e133e52 100644 --- a/crates/vim/src/command.rs +++ b/crates/vim/src/command.rs @@ -13,13 +13,12 @@ use editor::{ display_map::ToDisplayPoint, Bias, Editor, ToPoint, }; -use gpui::{actions, impl_actions, Action, AppContext, Global, ViewContext}; +use gpui::{actions, impl_actions, Action, AppContext, Global, ViewContext, WindowContext}; use language::Point; use multi_buffer::MultiBufferRow; use regex::Regex; use search::{BufferSearchBar, SearchOptions}; use serde::Deserialize; -use ui::WindowContext; use util::ResultExt; use workspace::{notifications::NotifyResultExt, SaveIntent}; diff --git a/crates/workspace/src/item.rs b/crates/workspace/src/item.rs index 4519b67192fb0..2808bd498f1ea 100644 --- a/crates/workspace/src/item.rs +++ b/crates/workspace/src/item.rs @@ -1057,11 +1057,10 @@ pub mod test { use gpui::{ AnyElement, AppContext, Context as _, EntityId, EventEmitter, FocusableView, InteractiveElement, IntoElement, Model, Render, SharedString, Task, View, ViewContext, - VisualContext, WeakView, + VisualContext, WeakView, WindowContext, }; use project::{Project, ProjectEntryId, ProjectPath, WorktreeId}; use std::{any::Any, cell::Cell, path::Path}; - use ui::WindowContext; pub struct TestProjectItem { pub entry_id: Option, @@ -1376,7 +1375,7 @@ pub mod test { fn cleanup( _workspace_id: WorkspaceId, _alive_items: Vec, - _cx: &mut ui::WindowContext, + _cx: &mut WindowContext, ) -> Task> { Task::ready(Ok(())) }