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:
Mikayla Maki
2023-11-13 17:14:56 -08:00
committed by GitHub
4 changed files with 22 additions and 14 deletions
+1 -2
View File
@@ -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;
};