diff --git a/Cargo.toml b/Cargo.toml index 87d76a3636de6fcf33431ae63b977e3236dcacae..be56964f753cded4b1e054583b989f798c3ca1e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -631,6 +631,7 @@ scap = { git = "https://github.com/zed-industries/scap", rev = "4afea48c3b002197 schemars = { version = "1.0", features = ["indexmap2"] } semver = "1.0" serde = { version = "1.0.221", features = ["derive", "rc"] } +serde_derive = "1.0.221" serde_json = { version = "1.0.144", features = ["preserve_order", "raw_value"] } serde_json_lenient = { version = "0.2", features = [ "preserve_order", @@ -724,6 +725,7 @@ yawc = "0.2.5" zeroize = "1.8" zstd = "0.11" + [workspace.dependencies.windows] version = "0.61" features = [ @@ -792,6 +794,19 @@ codegen-units = 16 codegen-units = 16 [profile.dev.package] +# proc-macros start +gpui_macros = { opt-level = 3 } +derive_refineable = { opt-level = 3 } +settings_macros = { opt-level = 3 } +sqlez_macros = { opt-level = 3, codegen-units = 1 } +ui_macros = { opt-level = 3 } +util_macros = { opt-level = 3 } +serde_derive = { opt-level = 3 } +quote = { opt-level = 3 } +syn = { opt-level = 3 } +proc-macro2 = { opt-level = 3 } +# proc-macros end + taffy = { opt-level = 3 } cranelift-codegen = { opt-level = 3 } cranelift-codegen-meta = { opt-level = 3 } @@ -833,7 +848,6 @@ semantic_version = { codegen-units = 1 } session = { codegen-units = 1 } snippet = { codegen-units = 1 } snippets_ui = { codegen-units = 1 } -sqlez_macros = { codegen-units = 1 } story = { codegen-units = 1 } supermaven_api = { codegen-units = 1 } telemetry_events = { codegen-units = 1 } diff --git a/crates/gpui/src/styled.rs b/crates/gpui/src/styled.rs index f653f050c07848340c8da1fa0e01a2a4da985bdb..b50432d332f7e26fdd4528c1644be3c9761b6ad0 100644 --- a/crates/gpui/src/styled.rs +++ b/crates/gpui/src/styled.rs @@ -13,8 +13,9 @@ const ELLIPSIS: SharedString = SharedString::new_static("…"); /// A trait for elements that can be styled. /// Use this to opt-in to a utility CSS-like styling API. +// gate on rust-analyzer so rust-analyzer never needs to expand this macro, it takes up to 10 seconds to expand due to inefficiencies in rust-analyzers proc-macro srv #[cfg_attr( - any(feature = "inspector", debug_assertions), + all(any(feature = "inspector", debug_assertions), not(rust_analyzer)), gpui_macros::derive_inspector_reflection )] pub trait Styled: Sized { diff --git a/crates/gpui_macros/tests/derive_inspector_reflection.rs b/crates/gpui_macros/tests/derive_inspector_reflection.rs index a0adcb7801e55d7272191a1e4e831b2c9c6b115c..92f4e56e9c0c48d9c9279e7bf1bb283eeb1139a7 100644 --- a/crates/gpui_macros/tests/derive_inspector_reflection.rs +++ b/crates/gpui_macros/tests/derive_inspector_reflection.rs @@ -1,8 +1,7 @@ //! This code was generated using Zed Agent with Claude Opus 4. -use gpui_macros::derive_inspector_reflection; - -#[derive_inspector_reflection] +// gate on rust-analyzer so rust-analyzer never needs to expand this macro, it takes up to 10 seconds to expand due to inefficiencies in rust-analyzers proc-macro srv +#[cfg_attr(not(rust_analyzer), gpui_macros::derive_inspector_reflection)] trait Transform: Clone { /// Doubles the value fn double(self) -> Self; diff --git a/crates/ui/src/traits/styled_ext.rs b/crates/ui/src/traits/styled_ext.rs index cf452a2826e75bd88910b605a90fe34aa0ea62bd..849e56a024ac1da03bb7a9de8dd574ea53f39627 100644 --- a/crates/ui/src/traits/styled_ext.rs +++ b/crates/ui/src/traits/styled_ext.rs @@ -18,7 +18,11 @@ fn elevated_borderless(this: E, cx: &mut App, index: ElevationIndex) } /// Extends [`gpui::Styled`] with Zed-specific styling methods. -#[cfg_attr(debug_assertions, gpui_macros::derive_inspector_reflection)] +// gate on rust-analyzer so rust-analyzer never needs to expand this macro, it takes up to 10 seconds to expand due to inefficiencies in rust-analyzers proc-macro srv +#[cfg_attr( + all(debug_assertions, not(rust_analyzer)), + gpui_macros::derive_inspector_reflection +)] pub trait StyledExt: Styled + Sized { /// Horizontally stacks elements. ///