feat: make svelte lsp install optional

This commit is contained in:
Ching Pei Yang 2023-09-19 01:40:56 +02:00
parent 232d93024c
commit 0e66f6282b

View file

@ -16,7 +16,11 @@ with builtins; let
lspconfig.svelte.setup { lspconfig.svelte.setup {
capabilities = capabilities; capabilities = capabilities;
on_attach = attach_keymaps, on_attach = attach_keymaps,
cmd = { "${cfg.lsp.package}/bin/svelteserver", "--stdio" } cmd = ${
if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/svelteserver", "--stdio"}''
}
} }
''; '';
}; };
@ -74,7 +78,7 @@ in {
package = mkOption { package = mkOption {
description = "Svelte LSP server package"; description = "Svelte 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;
}; };
}; };