feat: make sql lsp install optional

This commit is contained in:
Ching Pei Yang 2023-09-19 01:26:29 +02:00
parent 54f52bec2b
commit 35e86d1f12

View file

@ -20,7 +20,11 @@ with builtins; let
on_attach_keymaps(client, bufnr) on_attach_keymaps(client, bufnr)
require'sqls'.setup{} require'sqls'.setup{}
end, end,
cmd = { "${cfg.lsp.package}/bin/sqls", "-config", string.format("%s/config.yml", vim.fn.getcwd()) } cmd = ${
if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package
else ''{ "${cfg.lsp.package}/bin/sqls", "-config", string.format("%s/config.yml", vim.fn.getcwd()) }''
}
} }
''; '';
}; };
@ -88,7 +92,7 @@ in {
package = mkOption { package = mkOption {
description = "SQL LSP server package"; description = "SQL LSP server package";
type = types.package; type = with types; either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };