2024-01-04 00:12:21 +03:00
|
|
|
use gpui::{actions, impl_actions};
|
|
|
|
use gpui_macros::register_action;
|
2023-11-17 04:32:02 +03:00
|
|
|
use serde_derive::Deserialize;
|
|
|
|
|
|
|
|
#[test]
|
2023-12-11 05:33:38 +03:00
|
|
|
fn test_action_macros() {
|
|
|
|
actions!(test, [TestAction]);
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize)]
|
2023-11-17 04:32:02 +03:00
|
|
|
struct AnotherTestAction;
|
|
|
|
|
2023-12-11 05:33:38 +03:00
|
|
|
impl_actions!(test, [AnotherTestAction]);
|
|
|
|
|
2024-01-07 16:14:21 +03:00
|
|
|
#[derive(PartialEq, Clone, gpui::private::serde_derive::Deserialize)]
|
2023-11-17 04:32:02 +03:00
|
|
|
struct RegisterableAction {}
|
|
|
|
|
2023-12-11 05:33:38 +03:00
|
|
|
register_action!(RegisterableAction);
|
|
|
|
|
2023-11-17 04:32:02 +03:00
|
|
|
impl gpui::Action for RegisterableAction {
|
|
|
|
fn boxed_clone(&self) -> Box<dyn gpui::Action> {
|
2024-01-09 11:13:40 +03:00
|
|
|
unimplemented!()
|
2023-11-17 04:32:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn as_any(&self) -> &dyn std::any::Any {
|
2024-01-09 11:13:40 +03:00
|
|
|
unimplemented!()
|
2023-11-17 04:32:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn partial_eq(&self, _action: &dyn gpui::Action) -> bool {
|
2024-01-09 11:13:40 +03:00
|
|
|
unimplemented!()
|
2023-11-17 04:32:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn name(&self) -> &str {
|
2024-01-09 11:13:40 +03:00
|
|
|
unimplemented!()
|
2023-11-17 04:32:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn debug_name() -> &'static str
|
|
|
|
where
|
|
|
|
Self: Sized,
|
|
|
|
{
|
2024-01-09 11:13:40 +03:00
|
|
|
unimplemented!()
|
2023-11-17 04:32:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>
|
|
|
|
where
|
|
|
|
Self: Sized,
|
|
|
|
{
|
2024-01-09 11:13:40 +03:00
|
|
|
unimplemented!()
|
2023-11-17 04:32:02 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|