2023-04-17 20:27:27 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-08 02:16:46 +00:00
|
|
|
}: let
|
2024-03-12 00:46:29 +00:00
|
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
|
|
inherit (lib.strings) optionalString;
|
|
|
|
inherit (lib.attrsets) mapAttrs;
|
|
|
|
inherit (lib.nvim.dag) entryAfter;
|
2023-11-08 02:16:46 +00:00
|
|
|
|
2023-04-17 20:27:27 +00:00
|
|
|
cfg = config.vim.lsp;
|
|
|
|
in {
|
|
|
|
config = mkIf cfg.lspconfig.enable (mkMerge [
|
|
|
|
{
|
2024-03-12 00:46:29 +00:00
|
|
|
vim = {
|
|
|
|
lsp.enable = true;
|
2023-04-17 20:27:27 +00:00
|
|
|
|
2024-03-12 00:46:29 +00:00
|
|
|
startPlugins = ["nvim-lspconfig"];
|
2023-04-17 20:27:27 +00:00
|
|
|
|
2024-03-12 00:46:29 +00:00
|
|
|
luaConfigRC.lspconfig = entryAfter ["lsp-setup"] ''
|
|
|
|
local lspconfig = require('lspconfig')
|
2023-07-23 15:26:38 +00:00
|
|
|
|
2024-03-12 00:46:29 +00:00
|
|
|
${
|
|
|
|
optionalString config.vim.ui.borders.enable ''
|
|
|
|
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
|
|
|
|
''
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
2023-04-17 20:27:27 +00:00
|
|
|
}
|
|
|
|
{
|
2024-03-12 00:46:29 +00:00
|
|
|
vim.luaConfigRC = mapAttrs (_: v: (entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
|
2023-04-17 20:27:27 +00:00
|
|
|
}
|
|
|
|
]);
|
|
|
|
}
|