Improve actions macros (#3292)
- `actions!` now uses `#[action]` on each struct to reduce duplication. - The `#[action]` macro now works on unit structs. - Renamed `menu::unused` to `menu::init` and added more explanation in comments. Release Notes: - N/A
This commit is contained in:
commit
ca3341f066
4 changed files with 22 additions and 14 deletions
|
@ -176,8 +176,7 @@ macro_rules! actions {
|
|||
() => {};
|
||||
|
||||
( $name:ident ) => {
|
||||
#[gpui::register_action]
|
||||
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug, ::std::cmp::PartialEq, $crate::serde::Deserialize)]
|
||||
#[gpui::action]
|
||||
pub struct $name;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue