Add new drag API

This commit is contained in:
Mikayla 2023-12-13 13:40:19 -08:00
parent bfbbec0b01
commit a807e798ec
No known key found for this signature in database
8 changed files with 119 additions and 96 deletions

View file

@ -0,0 +1,23 @@
use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};
pub fn derive_render(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as DeriveInput);
let type_name = &ast.ident;
let (impl_generics, type_generics, where_clause) = ast.generics.split_for_impl();
let gen = quote! {
impl #impl_generics gpui::Render for #type_name #type_generics
#where_clause
{
type Element = ();
fn render(&mut self, _cx: &mut ViewContext<Self>) -> Self::Element {
()
}
}
};
gen.into()
}