This enables optimizations for our own proc-macros as well as some heavy
hitters. Additionally this gates the `derive_inspector_reflection` to be
skipped for rust-analyzer as it currently slows down rust-analyzer way
too much
Release Notes:
- N/A *or* Added/Fixed/Improved ...
@@ -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 {
@@ -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;
@@ -18,7 +18,11 @@ fn elevated_borderless<E: Styled>(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.
///