mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-11 21:00:35 +00:00
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Also: * Adds `impl_internal_actions!` for deriving the `Action` trait without registering. * Removes some deserializers that immediately fail in favor of `#[serde(skip)]` on fields where they were used. This also omits them from the schema. Release Notes: - Keymap settings file now has more JSON schema information to inform `json-language-server` completions and info, particularly for actions that take input.
51 lines
1.2 KiB
Rust
51 lines
1.2 KiB
Rust
use gpui::{actions, impl_actions};
|
|
use gpui_macros::register_action;
|
|
use schemars::JsonSchema;
|
|
use serde_derive::Deserialize;
|
|
|
|
#[test]
|
|
fn test_action_macros() {
|
|
actions!(test, [TestAction]);
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, JsonSchema)]
|
|
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> {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn as_any(&self) -> &dyn std::any::Any {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn partial_eq(&self, _action: &dyn gpui::Action) -> bool {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn name(&self) -> &str {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn debug_name() -> &'static str
|
|
where
|
|
Self: Sized,
|
|
{
|
|
unimplemented!()
|
|
}
|
|
|
|
fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>
|
|
where
|
|
Self: Sized,
|
|
{
|
|
unimplemented!()
|
|
}
|
|
}
|
|
}
|