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

@ -510,3 +510,8 @@
- Add inline typst concealing support under `vim.languages.typst` using
[typst-concealer].
[Shyrogan](https://github.com/Shyrogan):
- Add `vim.languages.tailwind.lsp.opts` option to Tailwind (for third party such as
[cva](https://beta.cva.style/)) along an example on how to use it.

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\\(([^)]*)\\)", "[\"'`]([^\"'`]+)[\"'`]" },
},
},
'';
};
};
};