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
|
@ -49,25 +49,25 @@ use workspace::{self, Pane, ResizeIntent, Workspace};
|
|||
use crate::state::ReplayableAction;
|
||||
|
||||
/// Used to resize the current pane
|
||||
#[derive(Clone, Deserialize, PartialEq)]
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq)]
|
||||
pub struct ResizePane(pub ResizeIntent);
|
||||
|
||||
/// An Action to Switch between modes
|
||||
#[derive(Clone, Deserialize, PartialEq)]
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq)]
|
||||
pub struct SwitchMode(pub Mode);
|
||||
|
||||
/// PushOperator is used to put vim into a "minor" mode,
|
||||
/// where it's waiting for a specific next set of keystrokes.
|
||||
/// For example 'd' needs a motion to complete.
|
||||
#[derive(Clone, Deserialize, PartialEq)]
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq)]
|
||||
pub struct PushOperator(pub Operator);
|
||||
|
||||
/// Number is used to manage vim's count. Pushing a digit
|
||||
/// multiplis the current value by 10 and adds the digit.
|
||||
#[derive(Clone, Deserialize, PartialEq)]
|
||||
/// multiplies the current value by 10 and adds the digit.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq)]
|
||||
struct Number(usize);
|
||||
|
||||
#[derive(Clone, Deserialize, PartialEq)]
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq)]
|
||||
struct SelectRegister(String);
|
||||
|
||||
actions!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue