2023-04-17 20:27:27 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib;
|
|
|
|
with builtins; let
|
|
|
|
cfg = config.vim.lsp;
|
|
|
|
in {
|
|
|
|
config = mkIf cfg.lspconfig.enable (mkMerge [
|
|
|
|
{
|
|
|
|
vim.lsp.enable = true;
|
|
|
|
|
|
|
|
vim.startPlugins = ["nvim-lspconfig"];
|
|
|
|
|
|
|
|
vim.luaConfigRC.lspconfig = nvim.dag.entryAfter ["lsp-setup"] ''
|
|
|
|
local lspconfig = require('lspconfig')
|
2023-07-23 15:26:38 +00:00
|
|
|
|
|
|
|
${
|
|
|
|
# TODO: make border style configurable
|
2023-07-26 07:27:57 +00:00
|
|
|
optionalString (config.vim.ui.borders.enable) ''
|
|
|
|
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
|
|
|
|
''
|
2023-07-23 15:26:38 +00:00
|
|
|
}
|
2023-04-17 20:27:27 +00:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
vim.luaConfigRC = mapAttrs (_: v: (nvim.dag.entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
}
|