Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Dequalify WindowContext and AsyncWindowContext identifiers (#22444)
Michael Sloan9815358bdd4d
diff --git a/Cargo.lock b/Cargo.lockindex 9a06b71f70a..eac03792799 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.rsindex 61f720be6d9..c72b909010c 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.rsindex 2d28e515ec4..45a0575911d 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<Picker<Self>>) {}- fn placeholder_text(&self, _cx: &mut ui::WindowContext) -> Arc<str> {+ fn placeholder_text(&self, _cx: &mut WindowContext) -> Arc<str> {"Enter a URL…".into()}diff --git a/crates/context_server/Cargo.toml b/crates/context_server/Cargo.tomlindex 410b897f285..e264bff2f4b 100644--- a/crates/context_server/Cargo.toml+++ b/crates/context_server/Cargo.toml@@ -28,7 +28,6 @@ serde.workspace = trueserde_json.workspace = truesettings.workspace = truesmol.workspace = true-ui.workspace = trueurl = { workspace = true, features = ["serde"] }util.workspace = trueworkspace.workspace = truediff --git a/crates/context_server/src/context_server_tool.rs b/crates/context_server/src/context_server_tool.rsindex 70740f710ac..161b61b22f2 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<Self>,input: serde_json::Value,_workspace: gpui::WeakView<workspace::Workspace>,- cx: &mut ui::WindowContext,+ cx: &mut WindowContext,) -> gpui::Task<gpui::Result<String>> {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.rsindex f4934c32b0a..923dcc24b9f 100644--- a/crates/editor/src/proposed_changes_editor.rs+++ b/crates/editor/src/proposed_changes_editor.rs@@ -288,7 +288,7 @@ impl EventEmitter<EditorEvent> for ProposedChangesEditor {}impl Item for ProposedChangesEditor {type Event = EditorEvent;- fn tab_icon(&self, _cx: &ui::WindowContext) -> Option<Icon> {+ fn tab_icon(&self, _cx: &WindowContext) -> Option<Icon> {Some(Icon::new(IconName::Diff))}diff --git a/crates/editor/src/scroll/actions.rs b/crates/editor/src/scroll/actions.rsindex eb49ac62190..df6f4c67cde 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<Editor>) {@@ -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.rsindex a5701801871..c367fe609f4 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.rsindex 2044ae520db..bf240b4bda7 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<gpui::Model<Self::ObservableEntity>> {+ fn observable_entity(&self) -> Option<Model<Self::ObservableEntity>> {None}}diff --git a/crates/repl/src/notebook/notebook_ui.rs b/crates/repl/src/notebook/notebook_ui.rsindex 395d1d59d83..84455d0ccf5 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<Icon> {+ fn tab_icon(&self, _cx: &WindowContext) -> Option<Icon> {Some(IconName::Book.into())}diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rsindex 660a2a161fd..632835e133e 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.rsindex 4519b67192f..2808bd498f1 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<ProjectEntryId>,@@ -1376,7 +1375,7 @@ pub mod test {fn cleanup(_workspace_id: WorkspaceId,_alive_items: Vec<ItemId>,- _cx: &mut ui::WindowContext,+ _cx: &mut WindowContext,) -> Task<anyhow::Result<()>> {Task::ready(Ok(()))}