feat(tailwind): allow for custom options in LSP (example with cva)

This commit is contained in:
Sébastien 2025-11-22 23:44:12 +01:00
commit 2d8093f468
2 changed files with 23 additions and 0 deletions

View file

@ -21,6 +21,11 @@
lspconfig.tailwindcss.setup {
capabilities = capabilities;
on_attach = default_on_attach;
settings = {
tailwindCSS = {
${cfg.lsp.opts}
},
},
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
@ -49,6 +54,19 @@ in {
type = either package (listOf str);
default = servers.${cfg.lsp.server}.package;
};
opts = mkOption {
description = "Options to pass to tailwindcss-lsp";
type = str;
default = "";
example = ''
experimental = {
classRegex = {
{ "cva\\(([^)]*)\\)", "[\"'`]([^\"'`]+)[\"'`]" },
},
},
'';
};
};
};