Skip to content

Commit d867aae

Browse files
committed
plugin/lsp: automatic keymap description
Add keymaps default descriptions for lsp buf and diagnostics Change-Id: I7a48ef3760e530a738efd7036b7ae5722c054256
1 parent 838829c commit d867aae

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plugins/lsp/default.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,14 @@ in
198198
let
199199
actionStr = action.action or action;
200200
actionProps = optionalAttrs (isAttrs action) (removeAttrs action [ "action" ]);
201+
desc =
202+
let
203+
split = splitString "." prefix;
204+
splitlen = length split;
205+
prefixFinal = (elemAt split (splitlen - 2)) + " ";
206+
optPrefix = optionalString (splitlen > 2) prefixFinal;
207+
in
208+
"Lsp " + optPrefix + actionStr;
201209
in
202210
{
203211
mode = "n";
@@ -206,6 +214,7 @@ in
206214

207215
options = {
208216
inherit (cfg.keymaps) silent;
217+
inherit desc;
209218
} // actionProps;
210219
}
211220
);

0 commit comments

Comments
 (0)