keymap_ui: Editor for action input in modal (#34080)

Closes #ISSUE

Adds a very simple editor for editing action input to the edit keybind
modal. No auto-complete yet.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Ben Kunkle 2025-07-08 14:39:55 -05:00 committed by GitHub
parent 1220049089
commit 6b7c30d7ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 140 additions and 74 deletions

View file

@ -426,12 +426,18 @@ impl KeymapFile {
}
}
/// Creates a JSON schema generator, suitable for generating json schemas
/// for actions
pub fn action_schema_generator() -> schemars::SchemaGenerator {
schemars::generate::SchemaSettings::draft2019_09().into_generator()
}
pub fn generate_json_schema_for_registered_actions(cx: &mut App) -> Value {
// instead of using DefaultDenyUnknownFields, actions typically use
// `#[serde(deny_unknown_fields)]` so that these cases are reported as parse failures. This
// is because the rest of the keymap will still load in these cases, whereas other settings
// files would not.
let mut generator = schemars::generate::SchemaSettings::draft2019_09().into_generator();
let mut generator = Self::action_schema_generator();
let action_schemas = cx.action_schemas(&mut generator);
let deprecations = cx.deprecated_actions_to_preferred_actions();