Merge branch 'main' into taffy

Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
Nathan Sobo 2023-08-14 13:44:53 -06:00
commit 740b105330
41 changed files with 536 additions and 113 deletions

View file

@ -14,3 +14,6 @@ lazy_static.workspace = true
proc-macro2 = "1.0"
syn = "1.0"
quote = "1.0"
[dev-dependencies]
gpui = { path = "../gpui" }

View file

@ -281,7 +281,7 @@ pub fn element_derive(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as DeriveInput);
let type_name = ast.ident;
let placeholder_view_generics: Generics = parse_quote! { <V> };
let placeholder_view_generics: Generics = parse_quote! { <V: 'static> };
let placeholder_view_type_name: Ident = parse_quote! { V };
let view_type_name: Ident;
let impl_generics: syn::ImplGenerics<'_>;

View file

@ -0,0 +1,14 @@
use gpui::{elements::Empty, Element, ViewContext};
// use gpui_macros::Element;
#[test]
fn test_derive_render_element() {
#[derive(Element)]
struct TestElement {}
impl TestElement {
fn render<V: 'static>(&mut self, _: &mut V, _: &mut ViewContext<V>) -> impl Element<V> {
Empty::new()
}
}
}