mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-08 03:11:36 +00:00
modules/lsp: switch to explicit lib calls
This commit is contained in:
parent
dfc7c6737f
commit
c488f0490f
33 changed files with 285 additions and 273 deletions
|
@ -3,32 +3,35 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim pushDownDefault;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings pushDownDefault;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
|
||||
self = import ./nvim-code-action-menu.nix {inherit lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.lsp.nvimCodeActionMenu.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.nvimCodeActionMenu.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) {
|
||||
vim.startPlugins = ["nvim-code-action-menu"];
|
||||
vim = {
|
||||
startPlugins = ["nvim-code-action-menu"];
|
||||
|
||||
vim.maps.normal = mkSetBinding mappings.open ":CodeActionMenu<CR>";
|
||||
maps.normal = mkSetBinding mappings.open ":CodeActionMenu<CR>";
|
||||
|
||||
vim.binds.whichKey.register = pushDownDefault {
|
||||
"<leader>c" = "+CodeAction";
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>c" = "+CodeAction";
|
||||
};
|
||||
|
||||
luaConfigRC.code-action-menu = entryAnywhere ''
|
||||
-- border configuration
|
||||
vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}'
|
||||
|
||||
-- show individual sections of the code action menu
|
||||
${lib.optionalString cfg.nvimCodeActionMenu.show.details "vim.g.code_action_menu_show_details = true"}
|
||||
${lib.optionalString cfg.nvimCodeActionMenu.show.diff "vim.g.code_action_menu_show_diff = true"}
|
||||
${lib.optionalString cfg.nvimCodeActionMenu.show.actionKind "vim.g.code_action_menu_show_action_kind = true"}
|
||||
'';
|
||||
};
|
||||
|
||||
vim.luaConfigRC.code-action-menu = nvim.dag.entryAnywhere ''
|
||||
-- border configuration
|
||||
vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}'
|
||||
|
||||
-- show individual sections of the code action menu
|
||||
${lib.optionalString (cfg.nvimCodeActionMenu.show.details) "vim.g.code_action_menu_show_details = true"}
|
||||
${lib.optionalString (cfg.nvimCodeActionMenu.show.diff) "vim.g.code_action_menu_show_diff = true"}
|
||||
${lib.optionalString (cfg.nvimCodeActionMenu.show.actionKind) "vim.g.code_action_menu_show_action_kind = true"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./nvim-code-action-menu.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
nvimCodeActionMenu = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue