diff --git a/crates/gpui3_macros/src/style_helpers.rs b/crates/gpui3_macros/src/style_helpers.rs index a254179190469c2c6b60bd3714a74f8f58118137..8090112077b0a04d2e8f4b5f88dbb4ae281ebaeb 100644 --- a/crates/gpui3_macros/src/style_helpers.rs +++ b/crates/gpui3_macros/src/style_helpers.rs @@ -36,6 +36,7 @@ fn generate_methods() -> Vec { quote! { DefiniteLength } }, &fields, + prefix_doc_string, )); for (suffix, length_tokens, suffix_doc_string) in box_suffixes() { @@ -68,6 +69,7 @@ fn generate_methods() -> Vec { prefix, quote! { AbsoluteLength }, &fields, + "todo!(docstring)", )); for (suffix, radius_tokens, doc_string) in corner_suffixes() { @@ -142,6 +144,7 @@ fn generate_custom_value_setter( prefix: &'static str, length_type: TokenStream2, fields: &Vec, + doc_string: &str, ) -> TokenStream2 { let method_name = format_ident!("{}", prefix); @@ -159,6 +162,7 @@ fn generate_custom_value_setter( .collect::>(); let method = quote! { + #[doc = #doc_string] fn #method_name(mut self, length: impl std::clone::Clone + Into) -> Self where Self: std::marker::Sized { let mut style = self.declared_style(); #(#field_assignments)* @@ -171,7 +175,12 @@ fn generate_custom_value_setter( fn box_prefixes() -> Vec<(&'static str, bool, Vec, &'static str)> { vec![ - ("w", true, vec![quote! { size.width }], "todo!(docstring)"), + ( + "w", + true, + vec![quote! { size.width }], + "Sets the width of the element. [Docs](https://tailwindcss.com/docs/width)", + ), ("h", true, vec![quote! { size.height }], "todo!(docstring)"), ( "size", diff --git a/crates/ui2/src/elements/label.rs b/crates/ui2/src/elements/label.rs index 46edeeadbee7b39aabbefeb289e7bb12de1f637a..0ac93d436a76dd016c45aa10ecbf06d9defe04ba 100644 --- a/crates/ui2/src/elements/label.rs +++ b/crates/ui2/src/elements/label.rs @@ -185,7 +185,11 @@ mod stories { } } - fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { + fn render( + &mut self, + _view: &mut S, + cx: &mut ViewContext, + ) -> impl Element { Story::container(cx) .child(Story::title_for::<_, Label>(cx)) .child(Story::label(cx, "Default"))