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