Improve keymap json schema (#23044)
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.
This commit is contained in:
parent
4c50201036
commit
6aba3950d2
37 changed files with 506 additions and 283 deletions
|
@ -36,6 +36,7 @@ notifications.workspace = true
|
|||
project.workspace = true
|
||||
remote.workspace = true
|
||||
rpc.workspace = true
|
||||
schemars.workspace = true
|
||||
serde.workspace = true
|
||||
settings.workspace = true
|
||||
smallvec.workspace = true
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
use gpui::{impl_actions, OwnedMenu, OwnedMenuItem, View};
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
use smallvec::SmallVec;
|
||||
use ui::{prelude::*, ContextMenu, PopoverMenu, PopoverMenuHandle, Tooltip};
|
||||
|
||||
impl_actions!(
|
||||
app_menu,
|
||||
[OpenApplicationMenu, NavigateApplicationMenuInDirection,]
|
||||
[OpenApplicationMenu, NavigateApplicationMenuInDirection]
|
||||
);
|
||||
|
||||
#[derive(Clone, Deserialize, PartialEq, Default)]
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Default)]
|
||||
pub struct OpenApplicationMenu(String);
|
||||
|
||||
#[derive(Clone, Deserialize, PartialEq, Default)]
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Default)]
|
||||
pub struct NavigateApplicationMenuInDirection(String);
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue