feat: expose typed core LSP binding actions

This commit is contained in:
Valdemar Lorenzen
2026-10-09 13:59:49 +02:00
parent e72f89a7ae
commit 529d1fd5b3
5 changed files with 27 additions and 5 deletions
+14
View File
@@ -254,6 +254,8 @@ enum Action {
Palette,
FilePicker,
FileExplorer,
LspDefinition,
LspDiagnostics,
}
// Names and mode eligibility are shared by configured bindings and the palette.
@@ -431,6 +433,16 @@ const CORE_ACTIONS: &[(&str, Action, &[Mode])] = &[
Action::FileExplorer,
&[Mode::Normal, Mode::Visual],
),
(
"core.lsp_definition",
Action::LspDefinition,
&[Mode::Normal],
),
(
"core.lsp_diagnostics",
Action::LspDiagnostics,
&[Mode::Normal],
),
];
impl Action {
@@ -1977,6 +1989,8 @@ impl Editor {
}
Action::FilePicker => self.open_file_picker(FilePresentation::Floating),
Action::FileExplorer => self.open_file_picker(FilePresentation::Docked),
Action::LspDefinition => return self.execute("lsp_definition"),
Action::LspDiagnostics => return self.execute("lsp_diagnostics"),
Action::Insert
| Action::InsertFirstNonblank
| Action::AppendLineEnd