zed/crates/gpui/tests/action_macros.rs
Piotr Osiewicz d475f1373a
gpui: Further docs refinement & moved some reexports into 'private' module (#3935)
This commit mostly fixes invalid URLs in docstrings. It also
encapsulates crates we reexport (serde stuff + linkme) into a public
module named "private" in order to reduce the API surfaced through docs.
Moreover, I fixed up a bunch of crates that were pulling serde_json in
through gpui explicitly instead of using Cargo manifest.

Release Notes:
- N/A
2024-01-07 14:14:21 +01:00

50 lines
1.1 KiB
Rust

use gpui::{actions, impl_actions};
use gpui_macros::register_action;
use serde_derive::Deserialize;
#[test]
fn test_action_macros() {
actions!(test, [TestAction]);
#[derive(PartialEq, Clone, Deserialize)]
struct AnotherTestAction;
impl_actions!(test, [AnotherTestAction]);
#[derive(PartialEq, Clone, gpui::private::serde_derive::Deserialize)]
struct RegisterableAction {}
register_action!(RegisterableAction);
impl gpui::Action for RegisterableAction {
fn boxed_clone(&self) -> Box<dyn gpui::Action> {
todo!()
}
fn as_any(&self) -> &dyn std::any::Any {
todo!()
}
fn partial_eq(&self, _action: &dyn gpui::Action) -> bool {
todo!()
}
fn name(&self) -> &str {
todo!()
}
fn debug_name() -> &'static str
where
Self: Sized,
{
todo!()
}
fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>
where
Self: Sized,
{
todo!()
}
}
}