Merge pull request #905 from rtsuk/toggle-inline-hints

Add command to toggle inlay hints
This commit is contained in:
Dongdong Zhou 2022-07-30 17:06:05 +01:00 committed by GitHub
commit 28d049c975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -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)]

View File

@ -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),
);
}
}
}