diff --git a/lapce-data/src/command.rs b/lapce-data/src/command.rs index 5413a6f6..23c15d52 100644 --- a/lapce-data/src/command.rs +++ b/lapce-data/src/command.rs @@ -397,6 +397,10 @@ pub enum LapceWorkbenchCommand { #[strum(serialize = "previous_editor_tab")] #[strum(message = "Previous editor tab")] PreviousEditorTab, + + #[strum(serialize = "toggle_inlay_hints")] + #[strum(message = "Toggle Inlay Hints")] + ToggleInlayHints, } #[derive(Debug, Clone)] diff --git a/lapce-data/src/data.rs b/lapce-data/src/data.rs index 8a75d51b..140d2637 100644 --- a/lapce-data/src/data.rs +++ b/lapce-data/src/data.rs @@ -1456,6 +1456,15 @@ pub fn run_workbench_command( )); } } + LapceWorkbenchCommand::ToggleInlayHints => { + let config = Arc::make_mut(&mut self.config); + config.editor.enable_inlay_hints = !config.editor.enable_inlay_hints; + Config::update_file( + "editor", + "enable-inlay-hints", + toml::Value::Boolean(config.editor.enable_inlay_hints), + ); + } } }