plugin/lsp: automatic keymap description

Add keymaps default descriptions for lsp buf and diagnostics

Change-Id: I7a48ef3760e530a738efd7036b7ae5722c054256
This commit is contained in:
Yury Shvedov 2024-12-01 14:15:58 +03:00
parent 838829c8f9
commit d867aaea43

View file

@ -198,6 +198,14 @@ in
let
actionStr = action.action or action;
actionProps = optionalAttrs (isAttrs action) (removeAttrs action [ "action" ]);
desc =
let
split = splitString "." prefix;
splitlen = length split;
prefixFinal = (elemAt split (splitlen - 2)) + " ";
optPrefix = optionalString (splitlen > 2) prefixFinal;
in
"Lsp " + optPrefix + actionStr;
in
{
mode = "n";
@ -206,6 +214,7 @@ in
options = {
inherit (cfg.keymaps) silent;
inherit desc;
} // actionProps;
}
);