action_macros.rs

 1use gpui::{actions, impl_actions};
 2use gpui_macros::register_action;
 3use schemars::JsonSchema;
 4use serde_derive::Deserialize;
 5
 6#[test]
 7fn test_action_macros() {
 8    actions!(test, [TestAction]);
 9
10    #[derive(PartialEq, Clone, Deserialize, JsonSchema)]
11    struct AnotherTestAction;
12
13    impl_actions!(test, [AnotherTestAction]);
14
15    #[derive(PartialEq, Clone, gpui::private::serde_derive::Deserialize)]
16    struct RegisterableAction {}
17
18    register_action!(RegisterableAction);
19
20    impl gpui::Action for RegisterableAction {
21        fn boxed_clone(&self) -> Box<dyn gpui::Action> {
22            unimplemented!()
23        }
24
25        fn as_any(&self) -> &dyn std::any::Any {
26            unimplemented!()
27        }
28
29        fn partial_eq(&self, _action: &dyn gpui::Action) -> bool {
30            unimplemented!()
31        }
32
33        fn name(&self) -> &str {
34            unimplemented!()
35        }
36
37        fn debug_name() -> &'static str
38        where
39            Self: Sized,
40        {
41            unimplemented!()
42        }
43
44        fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>
45        where
46            Self: Sized,
47        {
48            unimplemented!()
49        }
50    }
51}