keymap: Add ability to update user keymaps (#33487)
Closes #ISSUE The ability to update user keybindings in their keymap is required for #32436. This PR adds the ability to do so, reusing much of the existing infrastructure for updating settings JSON files. However, the existing JSON update functionality was intended to work only with objects, therefore, this PR simply wraps the object updating code with non-general keymap-specific array updating logic, that only works for top-level arrays and can only append or update entries in said top-level arrays. This limited API is reflected in the limited operations that the new `update_keymap` method on `KeymapFile` can take as arguments. Additionally, this PR pulls out the existing JSON updating code into its own module (where array updating code has been added) and adds a significant number of tests (hence the high line count in the diff) Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
parent
2823771c06
commit
ba1c05abf2
8 changed files with 2138 additions and 379 deletions
|
@ -1,8 +1,8 @@
|
|||
mod editable_setting_control;
|
||||
mod json_schema;
|
||||
mod key_equivalents;
|
||||
mod keymap_file;
|
||||
mod settings_file;
|
||||
mod settings_json;
|
||||
mod settings_store;
|
||||
mod vscode_import;
|
||||
|
||||
|
@ -12,16 +12,16 @@ use std::{borrow::Cow, fmt, str};
|
|||
use util::asset_str;
|
||||
|
||||
pub use editable_setting_control::*;
|
||||
pub use json_schema::*;
|
||||
pub use key_equivalents::*;
|
||||
pub use keymap_file::{
|
||||
KeyBindingValidator, KeyBindingValidatorRegistration, KeybindSource, KeymapFile,
|
||||
KeymapFileLoadResult,
|
||||
};
|
||||
pub use settings_file::*;
|
||||
pub use settings_json::*;
|
||||
pub use settings_store::{
|
||||
InvalidSettingsError, LocalSettingsKind, Settings, SettingsLocation, SettingsSources,
|
||||
SettingsStore, parse_json_with_comments,
|
||||
SettingsStore,
|
||||
};
|
||||
pub use vscode_import::{VsCodeSettings, VsCodeSettingsSource};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue