
Fix a bug where a GPUI macro still used `ModelContext` Rename `AsyncAppContext` -> `AsyncApp` Rename update_model, read_model, insert_model, and reserve_model to update_entity, read_entity, insert_entity, and reserve_entity Release Notes: - N/A
21 lines
643 B
Rust
21 lines
643 B
Rust
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
|
|
{
|
|
fn render(&mut self, _window: &mut gpui::Window, _cx: &mut gpui::Context<Self>) -> impl gpui::Element {
|
|
gpui::Empty
|
|
}
|
|
}
|
|
};
|
|
|
|
gen.into()
|
|
}
|