Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
gpui: Further docs refinement & moved some reexports into 'private' module (#3935)
Piotr Osiewiczd475f1373a08
diff --git a/Cargo.lock b/Cargo.lockindex c22fe57b478..54e2f483d8a 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -1380,6 +1380,7 @@ dependencies = ["schemars","serde","serde_derive",+ "serde_json","settings","smol","sum_tree",@@ -1545,6 +1546,7 @@ dependencies = ["schemars","serde","serde_derive",+ "serde_json","settings","smallvec","theme",@@ -2490,6 +2492,7 @@ dependencies = ["regex","serde","serde_derive",+ "serde_json","settings","smallvec","smol",@@ -3784,6 +3787,7 @@ dependencies = ["lsp","project","serde",+ "serde_json","settings","theme","tree-sitter",@@ -5511,6 +5515,7 @@ dependencies = ["picker","postage","project",+ "serde_json","settings","smol","text",@@ -7764,6 +7769,7 @@ dependencies = ["search","serde","serde_derive",+ "serde_json","settings","shellexpand","smallvec",@@ -7844,6 +7850,7 @@ dependencies = ["pathfinder_color","rust-embed","serde",+ "serde_json","simplelog","strum","theme",diff --git a/crates/ai/src/providers/open_ai/embedding.rs b/crates/ai/src/providers/open_ai/embedding.rsindex d5fe4e8c584..0a9b6ba969c 100644--- a/crates/ai/src/providers/open_ai/embedding.rs+++ b/crates/ai/src/providers/open_ai/embedding.rs@@ -1,8 +1,8 @@use anyhow::{anyhow, Result};use async_trait::async_trait;use futures::AsyncReadExt;+use gpui::AppContext;use gpui::BackgroundExecutor;-use gpui::{serde_json, AppContext};use isahc::http::StatusCode;use isahc::prelude::Configurable;use isahc::{AsyncBody, Response};@@ -11,6 +11,7 @@ use parking_lot::{Mutex, RwLock};use parse_duration::parse;use postage::watch;use serde::{Deserialize, Serialize};+use serde_json;use std::env;use std::ops::Add;use std::sync::Arc;diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.tomlindex c24cbca35be..03d6c06fe39 100644--- a/crates/client/Cargo.toml+++ b/crates/client/Cargo.toml@@ -36,6 +36,7 @@ rand.workspace = trueschemars.workspace = trueserde.workspace = trueserde_derive.workspace = true+serde_json.workspace = truesmol.workspace = truesysinfo.workspace = truetempfile = "3"diff --git a/crates/client/src/client.rs b/crates/client/src/client.rsindex b07dddc006d..3eae9d92bb9 100644--- a/crates/client/src/client.rs+++ b/crates/client/src/client.rs@@ -15,8 +15,8 @@ use futures::{TryFutureExt as _, TryStreamExt,};use gpui::{- actions, serde_json, AnyModel, AnyWeakModel, AppContext, AsyncAppContext, Model,- SemanticVersion, Task, WeakModel,+ actions, AnyModel, AnyWeakModel, AppContext, AsyncAppContext, Model, SemanticVersion, Task,+ WeakModel,};use lazy_static::lazy_static;use parking_lot::RwLock;@@ -25,6 +25,7 @@ use rand::prelude::*;use rpc::proto::{AnyTypedEnvelope, EntityMessage, EnvelopedMessage, PeerId, RequestMessage};use schemars::JsonSchema;use serde::{Deserialize, Serialize};+use serde_json;use settings::Settings;use std::{any::TypeId,diff --git a/crates/client/src/telemetry.rs b/crates/client/src/telemetry.rsindex 94d8369a698..26b5748187f 100644--- a/crates/client/src/telemetry.rs+++ b/crates/client/src/telemetry.rs@@ -1,10 +1,11 @@use crate::{TelemetrySettings, ZED_SECRET_CLIENT_TOKEN, ZED_SERVER_URL};use chrono::{DateTime, Utc};use futures::Future;-use gpui::{serde_json, AppContext, AppMetadata, BackgroundExecutor, Task};+use gpui::{AppContext, AppMetadata, BackgroundExecutor, Task};use lazy_static::lazy_static;use parking_lot::Mutex;use serde::Serialize;+use serde_json;use settings::{Settings, SettingsStore};use std::{env, io::Write, mem, path::PathBuf, sync::Arc, time::Duration};use sysinfo::{diff --git a/crates/collab_ui/Cargo.toml b/crates/collab_ui/Cargo.tomlindex 8206d89dce5..f845de3a939 100644--- a/crates/collab_ui/Cargo.toml+++ b/crates/collab_ui/Cargo.toml@@ -61,6 +61,7 @@ schemars.workspace = truepostage.workspace = trueserde.workspace = trueserde_derive.workspace = true+serde_json.workspace = truetime.workspace = truesmallvec.workspace = truediff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rsindex b142fcbe7f9..a13c0ed384f 100644--- a/crates/collab_ui/src/chat_panel.rs+++ b/crates/collab_ui/src/chat_panel.rs@@ -7,9 +7,9 @@ use collections::HashMap;use db::kvp::KEY_VALUE_STORE;use editor::Editor;use gpui::{- actions, div, list, prelude::*, px, serde_json, AnyElement, AppContext, AsyncWindowContext,- ClickEvent, ElementId, EventEmitter, FocusableView, ListOffset, ListScrollEvent, ListState,- Model, Render, Subscription, Task, View, ViewContext, VisualContext, WeakView,+ actions, div, list, prelude::*, px, AnyElement, AppContext, AsyncWindowContext, ClickEvent,+ ElementId, EventEmitter, FocusableView, ListOffset, ListScrollEvent, ListState, Model, Render,+ Subscription, Task, View, ViewContext, VisualContext, WeakView,};use language::LanguageRegistry;use menu::Confirm;diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rsindex 663883f9b4b..ee43b32f106 100644--- a/crates/collab_ui/src/collab_panel.rs+++ b/crates/collab_ui/src/collab_panel.rs@@ -15,12 +15,12 @@ use editor::{Editor, EditorElement, EditorStyle};use feature_flags::{ChannelsAlpha, FeatureFlagAppExt, FeatureFlagViewExt};use fuzzy::{match_strings, StringMatchCandidate};use gpui::{- actions, canvas, div, fill, list, overlay, point, prelude::*, px, serde_json, AnyElement,- AppContext, AsyncWindowContext, Bounds, ClipboardItem, DismissEvent, Div, EventEmitter,- FocusHandle, FocusableView, FontStyle, FontWeight, InteractiveElement, IntoElement, ListOffset,- ListState, Model, MouseDownEvent, ParentElement, Pixels, Point, PromptLevel, Render,- RenderOnce, SharedString, Styled, Subscription, Task, TextStyle, View, ViewContext,- VisualContext, WeakView, WhiteSpace,+ actions, canvas, div, fill, list, overlay, point, prelude::*, px, AnyElement, AppContext,+ AsyncWindowContext, Bounds, ClipboardItem, DismissEvent, Div, EventEmitter, FocusHandle,+ FocusableView, FontStyle, FontWeight, InteractiveElement, IntoElement, ListOffset, ListState,+ Model, MouseDownEvent, ParentElement, Pixels, Point, PromptLevel, Render, RenderOnce,+ SharedString, Styled, Subscription, Task, TextStyle, View, ViewContext, VisualContext,+ WeakView, WhiteSpace,};use menu::{Cancel, Confirm, SelectNext, SelectPrev};use project::{Fs, Project};diff --git a/crates/collab_ui/src/notification_panel.rs b/crates/collab_ui/src/notification_panel.rsindex b7a18365bee..e7c94984b22 100644--- a/crates/collab_ui/src/notification_panel.rs+++ b/crates/collab_ui/src/notification_panel.rs@@ -6,11 +6,11 @@ use collections::HashMap;use db::kvp::KEY_VALUE_STORE;use futures::StreamExt;use gpui::{- actions, div, img, list, px, serde_json, AnyElement, AppContext, AsyncWindowContext,- CursorStyle, DismissEvent, Element, EventEmitter, FocusHandle, FocusableView,- InteractiveElement, IntoElement, ListAlignment, ListScrollEvent, ListState, Model,- ParentElement, Render, StatefulInteractiveElement, Styled, Task, View, ViewContext,- VisualContext, WeakView, WindowContext,+ actions, div, img, list, px, AnyElement, AppContext, AsyncWindowContext, CursorStyle,+ DismissEvent, Element, EventEmitter, FocusHandle, FocusableView, InteractiveElement,+ IntoElement, ListAlignment, ListScrollEvent, ListState, Model, ParentElement, Render,+ StatefulInteractiveElement, Styled, Task, View, ViewContext, VisualContext, WeakView,+ WindowContext,};use notifications::{NotificationEntry, NotificationEvent, NotificationStore};use project::Fs;diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rsindex b64e3cccc3e..66f28db3e46 100644--- a/crates/editor/src/editor_tests.rs+++ b/crates/editor/src/editor_tests.rs@@ -9,11 +9,7 @@ use crate::{};use futures::StreamExt;-use gpui::{- div,- serde_json::{self, json},- TestAppContext, VisualTestContext, WindowBounds, WindowOptions,-};+use gpui::{div, TestAppContext, VisualTestContext, WindowBounds, WindowOptions};use indoc::indoc;use language::{language_settings::{AllLanguageSettings, AllLanguageSettingsContent, LanguageSettingsContent},@@ -24,6 +20,7 @@ use language::{use parking_lot::Mutex;use project::project_settings::{LspSettings, ProjectSettings};use project::FakeFs;+use serde_json::{self, json};use std::sync::atomic;use std::sync::atomic::AtomicUsize;use std::{cell::RefCell, future::Future, rc::Rc, time::Instant};diff --git a/crates/editor/src/test/editor_test_context.rs b/crates/editor/src/test/editor_test_context.rsindex 18916f844ce..3289471e81c 100644--- a/crates/editor/src/test/editor_test_context.rs+++ b/crates/editor/src/test/editor_test_context.rs@@ -39,7 +39,7 @@ impl EditorTestContext {// fs.insert_file("/file", "".to_owned()).await;fs.insert_tree("/root",- gpui::serde_json::json!({+ serde_json::json!({"file": "",}),)diff --git a/crates/feedback/Cargo.toml b/crates/feedback/Cargo.tomlindex e14df6a2d48..32ecee529c2 100644--- a/crates/feedback/Cargo.toml+++ b/crates/feedback/Cargo.toml@@ -36,6 +36,7 @@ postage.workspace = trueregex.workspace = trueserde.workspace = trueserde_derive.workspace = true+serde_json.workspace = truesmallvec.workspace = truesmol.workspace = truesysinfo.workspace = truediff --git a/crates/feedback/src/feedback_modal.rs b/crates/feedback/src/feedback_modal.rsindex 87d39186711..6c5308c1c64 100644--- a/crates/feedback/src/feedback_modal.rs+++ b/crates/feedback/src/feedback_modal.rs@@ -7,8 +7,8 @@ use db::kvp::KEY_VALUE_STORE;use editor::{Editor, EditorEvent};use futures::AsyncReadExt;use gpui::{- div, red, rems, serde_json, AppContext, DismissEvent, EventEmitter, FocusHandle, FocusableView,- Model, PromptLevel, Render, Task, View, ViewContext,+ div, red, rems, AppContext, DismissEvent, EventEmitter, FocusHandle, FocusableView, Model,+ PromptLevel, Render, Task, View, ViewContext,};use isahc::Request;use language::Buffer;diff --git a/crates/gpui/src/action.rs b/crates/gpui/src/action.rsindex 54682a30ef9..e335c4255e4 100644--- a/crates/gpui/src/action.rs+++ b/crates/gpui/src/action.rs@@ -29,7 +29,7 @@ use std::any::{Any, TypeId};/// macro, which only generates the code needed to register your action before `main`.////// ```-/// #[derive(gpui::serde::Deserialize, std::cmp::PartialEq, std::clone::Clone)]+/// #[derive(gpui::private::serde::Deserialize, std::cmp::PartialEq, std::clone::Clone)]/// pub struct Paste {/// pub content: SharedString,/// }@@ -158,12 +158,12 @@ impl ActionRegistry {macro_rules! actions {($namespace:path, [ $($name:ident),* $(,)? ]) => {$(- #[derive(::std::cmp::PartialEq, ::std::clone::Clone, ::std::default::Default, gpui::serde_derive::Deserialize)]- #[serde(crate = "gpui::serde")]+ #[derive(::std::cmp::PartialEq, ::std::clone::Clone, ::std::default::Default, gpui::private::serde_derive::Deserialize)]+ #[serde(crate = "gpui::private::serde")]pub struct $name;gpui::__impl_action!($namespace, $name,- fn build(_: gpui::serde_json::Value) -> gpui::Result<::std::boxed::Box<dyn gpui::Action>> {+ fn build(_: gpui::private::serde_json::Value) -> gpui::Result<::std::boxed::Box<dyn gpui::Action>> {Ok(Box::new(Self))});@@ -179,8 +179,8 @@ macro_rules! impl_actions {($namespace:path, [ $($name:ident),* $(,)? ]) => {$(gpui::__impl_action!($namespace, $name,- fn build(value: gpui::serde_json::Value) -> gpui::Result<::std::boxed::Box<dyn gpui::Action>> {- Ok(std::boxed::Box::new(gpui::serde_json::from_value::<Self>(value)?))+ fn build(value: gpui::private::serde_json::Value) -> gpui::Result<::std::boxed::Box<dyn gpui::Action>> {+ Ok(std::boxed::Box::new(gpui::private::serde_json::from_value::<Self>(value)?))});diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rsindex 2a0ff545e92..638396abc51 100644--- a/crates/gpui/src/app.rs+++ b/crates/gpui/src/app.rs@@ -43,7 +43,7 @@ use util::{ResultExt,};-/// Temporary(?) wrapper around RefCell<AppContext> to help us debug any double borrows.+/// Temporary(?) wrapper around [`RefCell<AppContext>`] to help us debug any double borrows./// Strongly consider removing after stabilization.pub struct AppCell {app: RefCell<AppContext>,@@ -964,7 +964,7 @@ impl AppContext {/// Event handlers propagate events by default. Call this method to stop dispatching to/// event handlers with a lower z-index (mouse) or higher in the tree (keyboard). This is- /// the opposite of [propagate]. It's also possible to cancel a call to [propagate] by+ /// the opposite of [`Self::propagate`]. It's also possible to cancel a call to [`Self::propagate`] by/// calling this method before effects are flushed.pub fn stop_propagation(&mut self) {self.propagate_event = false;@@ -972,7 +972,7 @@ impl AppContext {/// Action handlers stop propagation by default during the bubble phase of action dispatch/// dispatching to action handlers higher in the element tree. This is the opposite of- /// [stop_propagation]. It's also possible to cancel a call to [stop_propagate] by calling+ /// [`Self::stop_propagation`]. It's also possible to cancel a call to [`Self::stop_propagation`] by calling/// this method before effects are flushed.pub fn propagate(&mut self) {self.propagate_event = true;diff --git a/crates/gpui/src/app/entity_map.rs b/crates/gpui/src/app/entity_map.rsindex 97f680560a3..17f6e47ddfe 100644--- a/crates/gpui/src/app/entity_map.rs+++ b/crates/gpui/src/app/entity_map.rs@@ -1,4 +1,4 @@-use crate::{private::Sealed, AppContext, Context, Entity, ModelContext};+use crate::{seal::Sealed, AppContext, Context, Entity, ModelContext};use anyhow::{anyhow, Result};use derive_more::{Deref, DerefMut};use parking_lot::{RwLock, RwLockUpgradableReadGuard};diff --git a/crates/gpui/src/geometry.rs b/crates/gpui/src/geometry.rsindex d68ab89f6c8..a50de8c3442 100644--- a/crates/gpui/src/geometry.rs+++ b/crates/gpui/src/geometry.rs@@ -1582,7 +1582,6 @@ impl From<f32> for Edges<Pixels> {/// Represents the corners of a box in a 2D space, such as border radius.////// Each field represents the size of the corner on one side of the box: `top_left`, `top_right`, `bottom_right`, and `bottom_left`.-/// ```#[derive(Refineable, Clone, Default, Debug, Eq, PartialEq)]#[refineable(Debug)]#[repr(C)]@@ -2263,7 +2262,7 @@ impl From<f64> for GlobalPixels {}}-/// Represents a length in rems, a unit based on the font-size of the window, which can be assigned with [WindowContext::set_rem_size].+/// Represents a length in rems, a unit based on the font-size of the window, which can be assigned with [`WindowContext::set_rem_size`][set_rem_size].////// Rems are used for defining lengths that are scalable and consistent across different UI elements./// The value of `1rem` is typically equal to the font-size of the root element (often the `<html>` element in browsers),@@ -2271,6 +2270,8 @@ impl From<f64> for GlobalPixels {/// purpose, allowing for scalable and accessible design that can adjust to different display settings or user preferences.////// For example, if the root element's font-size is `16px`, then `1rem` equals `16px`. A length of `2rems` would then be `32px`.+///+/// [set_rem_size]: crate::WindowContext::set_rem_size#[derive(Clone, Copy, Default, Add, Sub, Mul, Div, Neg)]pub struct Rems(pub f32);diff --git a/crates/gpui/src/gpui.rs b/crates/gpui/src/gpui.rsindex 868822d59bd..d5236d8f08c 100644--- a/crates/gpui/src/gpui.rs+++ b/crates/gpui/src/gpui.rs@@ -30,7 +30,16 @@ mod util;mod view;mod window;-mod private {+/// Do not touch, here be dragons for use by gpui_macros and such.+#[doc(hidden)]+pub mod private {+ pub use linkme;+ pub use serde;+ pub use serde_derive;+ pub use serde_json;+}++mod seal {/// A mechanism for restricting implementations of a trait to only those in GPUI./// See: https://predr.ag/blog/definitive-guide-to-sealed-traits-in-rust/pub trait Sealed {}@@ -53,16 +62,11 @@ pub use input::*;pub use interactive::*;pub use key_dispatch::*;pub use keymap::*;-pub use linkme;pub use platform::*;-use private::Sealed;pub use refineable::*;pub use scene::*;-pub use serde;-pub use serde_derive;-pub use serde_json;+use seal::Sealed;pub use shared_string::*;-pub use smallvec;pub use smol::Timer;pub use style::*;pub use styled::*;diff --git a/crates/gpui/src/input.rs b/crates/gpui/src/input.rsindex 8592eeffeb3..da240a77a8b 100644--- a/crates/gpui/src/input.rs+++ b/crates/gpui/src/input.rs@@ -5,8 +5,8 @@ use std::ops::Range;/// Implement this trait to allow views to handle textual input when implementing an editor, field, etc.///-/// Once your view `V` implements this trait, you can use it to construct an [ElementInputHandler<V>].-/// This input handler can then be assigned during paint by calling [WindowContext::handle_input].+/// Once your view `V` implements this trait, you can use it to construct an [`ElementInputHandler<V>`].+/// This input handler can then be assigned during paint by calling [`WindowContext::handle_input`].pub trait InputHandler: 'static + Sized {fn text_for_range(&mut self, range: Range<usize>, cx: &mut ViewContext<Self>)-> Option<String>;@@ -43,8 +43,10 @@ pub struct ElementInputHandler<V> {}impl<V: 'static> ElementInputHandler<V> {- /// Used in [Element::paint] with the element's bounds and a view context for its+ /// Used in [`Element::paint`][element_paint] with the element's bounds and a view context for its/// containing view.+ ///+ /// [element_paint]: crate::Element::paintpub fn new(element_bounds: Bounds<Pixels>, view: View<V>, cx: &mut WindowContext) -> Self {ElementInputHandler {view,diff --git a/crates/gpui/src/platform/mac/display_linker.rs b/crates/gpui/src/platform/mac/display_linker.rsindex e367d22b3d7..8f1b233046f 100644--- a/crates/gpui/src/platform/mac/display_linker.rs+++ b/crates/gpui/src/platform/mac/display_linker.rs@@ -94,7 +94,7 @@ unsafe extern "C" fn trampoline(mod sys {//! Derived from display-link crate under the fololwing license:- //! https://github.com/BrainiumLLC/display-link/blob/master/LICENSE-MIT+ //! <https://github.com/BrainiumLLC/display-link/blob/master/LICENSE-MIT>//! Apple docs: [CVDisplayLink](https://developer.apple.com/documentation/corevideo/cvdisplaylinkoutputcallback?language=objc)#![allow(dead_code, non_upper_case_globals)]diff --git a/crates/gpui/src/view.rs b/crates/gpui/src/view.rsindex 88e564d27fe..6e6223cbbea 100644--- a/crates/gpui/src/view.rs+++ b/crates/gpui/src/view.rs@@ -1,5 +1,5 @@use crate::{- private::Sealed, AnyElement, AnyModel, AnyWeakModel, AppContext, AvailableSpace, BorrowWindow,+ seal::Sealed, AnyElement, AnyModel, AnyWeakModel, AppContext, AvailableSpace, BorrowWindow,Bounds, Element, ElementId, Entity, EntityId, Flatten, FocusHandle, FocusableView, IntoElement,LayoutId, Model, Pixels, Point, Render, Size, ViewContext, VisualContext, WeakModel,WindowContext,diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rsindex a0d3d0f886b..7e4c5f93f95 100644--- a/crates/gpui/src/window.rs+++ b/crates/gpui/src/window.rs@@ -1826,9 +1826,11 @@ impl<'a> WindowContext<'a> {result}- /// Set an input handler, such as [ElementInputHandler], which interfaces with the+ /// Set an input handler, such as [`ElementInputHandler`][element_input_handler], which interfaces with the/// platform to receive textual input with proper integration with concerns such/// as IME interactions.+ ///+ /// [element_input_handler]: crate::ElementInputHandlerpub fn handle_input(&mut self,focus_handle: &FocusHandle,@@ -2500,8 +2502,7 @@ impl<'a, V: 'static> ViewContext<'a, V> {}/// Register a listener to be called when the given focus handle receives focus.- /// Unlike [on_focus_changed], returns a subscription and persists until the subscription- /// is dropped.+ /// Returns a subscription and persists until the subscription is dropped.pub fn on_focus(&mut self,handle: &FocusHandle,@@ -2527,8 +2528,7 @@ impl<'a, V: 'static> ViewContext<'a, V> {}/// Register a listener to be called when the given focus handle or one of its descendants receives focus.- /// Unlike [on_focus_changed], returns a subscription and persists until the subscription- /// is dropped.+ /// Returns a subscription and persists until the subscription is dropped.pub fn on_focus_in(&mut self,handle: &FocusHandle,@@ -2554,8 +2554,7 @@ impl<'a, V: 'static> ViewContext<'a, V> {}/// Register a listener to be called when the given focus handle loses focus.- /// Unlike [on_focus_changed], returns a subscription and persists until the subscription- /// is dropped.+ /// Returns a subscription and persists until the subscription is dropped.pub fn on_blur(&mut self,handle: &FocusHandle,@@ -2581,8 +2580,7 @@ impl<'a, V: 'static> ViewContext<'a, V> {}/// Register a listener to be called when the window loses focus.- /// Unlike [on_focus_changed], returns a subscription and persists until the subscription- /// is dropped.+ /// Returns a subscription and persists until the subscription is dropped.pub fn on_blur_window(&mut self,mut listener: impl FnMut(&mut V, &mut ViewContext<V>) + 'static,@@ -2597,8 +2595,7 @@ impl<'a, V: 'static> ViewContext<'a, V> {}/// Register a listener to be called when the given focus handle or one of its descendants loses focus.- /// Unlike [on_focus_changed], returns a subscription and persists until the subscription- /// is dropped.+ /// Returns a subscription and persists until the subscription is dropped.pub fn on_focus_out(&mut self,handle: &FocusHandle,diff --git a/crates/gpui/tests/action_macros.rs b/crates/gpui/tests/action_macros.rsindex f77d8a2d0da..9e5f6dea16c 100644--- a/crates/gpui/tests/action_macros.rs+++ b/crates/gpui/tests/action_macros.rs@@ -11,7 +11,7 @@ fn test_action_macros() {impl_actions!(test, [AnotherTestAction]);- #[derive(PartialEq, Clone, gpui::serde_derive::Deserialize)]+ #[derive(PartialEq, Clone, gpui::private::serde_derive::Deserialize)]struct RegisterableAction {}register_action!(RegisterableAction);diff --git a/crates/gpui_macros/src/register_action.rs b/crates/gpui_macros/src/register_action.rsindex 9e3a473843d..c18e4f4b89a 100644--- a/crates/gpui_macros/src/register_action.rs+++ b/crates/gpui_macros/src/register_action.rs@@ -36,8 +36,8 @@ pub(crate) fn register_action(type_name: &Ident) -> proc_macro2::TokenStream {quote! {#[doc(hidden)]- #[gpui::linkme::distributed_slice(gpui::__GPUI_ACTIONS)]- #[linkme(crate = gpui::linkme)]+ #[gpui::private::linkme::distributed_slice(gpui::__GPUI_ACTIONS)]+ #[linkme(crate = gpui::private::linkme)]static #static_slice_name: gpui::MacroActionBuilder = #action_builder_fn_name;/// This is an auto generated function, do not use.diff --git a/crates/language_tools/Cargo.toml b/crates/language_tools/Cargo.tomlindex 0bf064092e4..1681e78425f 100644--- a/crates/language_tools/Cargo.toml+++ b/crates/language_tools/Cargo.toml@@ -24,6 +24,7 @@ futures.workspace = trueserde.workspace = trueanyhow.workspace = truetree-sitter.workspace = true+serde_json.workspace = true[dev-dependencies]client = { path = "../client", features = ["test-support"] }diff --git a/crates/language_tools/src/lsp_log_tests.rs b/crates/language_tools/src/lsp_log_tests.rsindex 194b6d1ae8d..14683ae8069 100644--- a/crates/language_tools/src/lsp_log_tests.rs+++ b/crates/language_tools/src/lsp_log_tests.rs@@ -4,9 +4,10 @@ use crate::lsp_log::LogMenuItem;use super::*;use futures::StreamExt;-use gpui::{serde_json::json, Context, TestAppContext, VisualTestContext};+use gpui::{Context, TestAppContext, VisualTestContext};use language::{tree_sitter_rust, FakeLspAdapter, Language, LanguageConfig, LanguageServerName};use project::{FakeFs, Project};+use serde_json::json;use settings::SettingsStore;#[gpui::test]diff --git a/crates/project_symbols/Cargo.toml b/crates/project_symbols/Cargo.tomlindex 91cc882e41e..da96fb2db56 100644--- a/crates/project_symbols/Cargo.toml+++ b/crates/project_symbols/Cargo.toml@@ -24,6 +24,7 @@ anyhow.workspace = trueordered-float.workspace = truepostage.workspace = truesmol.workspace = true+serde_json.workspace = true[dev-dependencies]futures.workspace = truediff --git a/crates/project_symbols/src/project_symbols.rs b/crates/project_symbols/src/project_symbols.rsindex 3c2760f720c..ed31ebd9499 100644--- a/crates/project_symbols/src/project_symbols.rs+++ b/crates/project_symbols/src/project_symbols.rs@@ -260,9 +260,10 @@ impl PickerDelegate for ProjectSymbolsDelegate {mod tests {use super::*;use futures::StreamExt;- use gpui::{serde_json::json, TestAppContext, VisualContext};+ use gpui::{TestAppContext, VisualContext};use language::{FakeLspAdapter, Language, LanguageConfig};use project::FakeFs;+ use serde_json::json;use settings::SettingsStore;use std::{path::Path, sync::Arc};diff --git a/crates/terminal_view/Cargo.toml b/crates/terminal_view/Cargo.tomlindex d8484601834..811d420045d 100644--- a/crates/terminal_view/Cargo.toml+++ b/crates/terminal_view/Cargo.toml@@ -36,6 +36,7 @@ thiserror.workspace = truelazy_static.workspace = trueserde.workspace = trueserde_derive.workspace = true+serde_json.workspace = true[dev-dependencies]editor = { path = "../editor", features = ["test-support"] }diff --git a/crates/terminal_view/src/terminal_panel.rs b/crates/terminal_view/src/terminal_panel.rsindex c0f8e6209b2..99929535700 100644--- a/crates/terminal_view/src/terminal_panel.rs+++ b/crates/terminal_view/src/terminal_panel.rs@@ -3,9 +3,9 @@ use std::{ops::ControlFlow, path::PathBuf, sync::Arc};use crate::TerminalView;use db::kvp::KEY_VALUE_STORE;use gpui::{- actions, serde_json, AppContext, AsyncWindowContext, Entity, EventEmitter, ExternalPaths,- FocusHandle, FocusableView, IntoElement, ParentElement, Pixels, Render, Styled, Subscription,- Task, View, ViewContext, VisualContext, WeakView, WindowContext,+ actions, AppContext, AsyncWindowContext, Entity, EventEmitter, ExternalPaths, FocusHandle,+ FocusableView, IntoElement, ParentElement, Pixels, Render, Styled, Subscription, Task, View,+ ViewContext, VisualContext, WeakView, WindowContext,};use itertools::Itertools;use project::{Fs, ProjectEntryId};diff --git a/crates/theme_importer/Cargo.toml b/crates/theme_importer/Cargo.tomlindex 1b0c39fee72..7bcb2daa633 100644--- a/crates/theme_importer/Cargo.toml+++ b/crates/theme_importer/Cargo.toml@@ -18,6 +18,7 @@ palette = { version = "0.7.3", default-features = false, features = ["std"] }pathfinder_color = "0.5"rust-embed.workspace = trueserde.workspace = true+serde_json.workspace = truesimplelog = "0.9"strum = { version = "0.25.0", features = ["derive"] }theme = { path = "../theme", features = ["importing-themes"] }diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rsindex 3a7e0b20d55..ff20d36a5df 100644--- a/crates/theme_importer/src/main.rs+++ b/crates/theme_importer/src/main.rs@@ -16,7 +16,6 @@ use any_ascii::any_ascii;use anyhow::{anyhow, Context, Result};use clap::Parser;use convert_case::{Case, Casing};-use gpui::serde_json;use indexmap::IndexMap;use indoc::formatdoc;use json_comments::StripComments;diff --git a/crates/theme_importer/src/zed1/converter.rs b/crates/theme_importer/src/zed1/converter.rsindex 86c40dfde55..9f40c3695fc 100644--- a/crates/theme_importer/src/zed1/converter.rs+++ b/crates/theme_importer/src/zed1/converter.rs@@ -1,5 +1,5 @@use anyhow::{Context, Result};-use gpui::{serde_json, Hsla, Rgba};+use gpui::{Hsla, Rgba};use theme::{color_alpha, Appearance, PlayerColor, PlayerColors, StatusColorsRefinement,ThemeColorsRefinement, UserFontStyle, UserFontWeight, UserHighlightStyle, UserSyntaxTheme,diff --git a/crates/theme_importer/src/zed1/theme.rs b/crates/theme_importer/src/zed1/theme.rsindex 7743fba0b1b..70efb6ab2bf 100644--- a/crates/theme_importer/src/zed1/theme.rs+++ b/crates/theme_importer/src/zed1/theme.rs@@ -6,10 +6,10 @@ use std::fmt;use std::ops::{Deref, DerefMut};use std::sync::Arc;-use gpui::serde_json::{self, Value};use pathfinder_color::ColorU;use serde::de::{self, DeserializeOwned, Unexpected};use serde::{Deserialize, Deserializer};+use serde_json::{self, Value};#[derive(Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]#[repr(transparent)]