neovim-flake/modules/plugins/lsp/lspconfig/config.nix
diniamo a0197fe1bb treewide: migrate to pluginRC for correct DAG order
The "new" DAG order is as follows:
- (luaConfigPre)
- globalsScript
- basic
- theme
- pluginConfigs
- extraPluginConfigs
- mappings
- (luaConfigPost)
2024-07-18 10:25:58 +02:00

35 lines
805 B
Nix

{
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.strings) optionalString;
inherit (lib.attrsets) mapAttrs;
inherit (lib.nvim.dag) entryAfter;
cfg = config.vim.lsp;
in {
config = mkIf cfg.lspconfig.enable (mkMerge [
{
vim = {
lsp.enable = true;
startPlugins = ["nvim-lspconfig"];
pluginRC.lspconfig = entryAfter ["lsp-setup"] ''
local lspconfig = require('lspconfig')
${
optionalString config.vim.ui.borders.enable ''
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
''
}
'';
};
}
{
vim.pluginRC = mapAttrs (_: v: (entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
}
]);
}