Re-introduce a macro for defining actions for ease of use

Co-Authored-By: Piotr Osiewicz <piotr@zed.dev>
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
Julia 2023-11-07 11:00:30 -05:00
parent 2e43015664
commit 643146d768
5 changed files with 57 additions and 28 deletions

View file

@ -1233,8 +1233,6 @@ pub type KeyListener<V> = Box<
#[cfg(test)]
mod test {
use serde_derive::Deserialize;
use crate::{
self as gpui, div, Div, FocusHandle, KeyBinding, Keystroke, ParentElement, Render,
StatefulInteraction, StatelessInteractive, TestAppContext, VisualContext,
@ -1246,8 +1244,7 @@ mod test {
focus_handle: FocusHandle,
}
#[derive(PartialEq, Clone, Default, Deserialize)]
struct TestAction;
actions!(TestAction);
impl Render for TestView {
type Element = Div<Self, StatefulInteraction<Self>>;