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;
|
2024-09-13 16:34:21 +00:00
|
|
|
inherit (lib.nvim.lua) toLuaObject;
|
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-07-20 08:30:48 +00:00
|
|
|
pluginRC.lspconfig = entryAfter ["lsp-setup"] ''
|
2024-03-12 00:46:29 +00:00
|
|
|
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 ''
|
2024-09-13 16:34:21 +00:00
|
|
|
require('lspconfig.ui.windows').default_options.border = ${toLuaObject config.vim.ui.borders.globalStyle}
|
2024-03-12 00:46:29 +00:00
|
|
|
''
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
2023-04-17 20:27:27 +00:00
|
|
|
}
|
|
|
|
{
|
2024-07-20 08:30:48 +00:00
|
|
|
vim.pluginRC = mapAttrs (_: v: (entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
|
2023-04-17 20:27:27 +00:00
|
|
|
}
|
|
|
|
]);
|
|
|
|
}
|