mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-10 14:13:54 +00:00
feat(tailwind): allow for custom options in LSP (example with cva)
This commit is contained in:
parent
09470524a2
commit
2d8093f468
2 changed files with 23 additions and 0 deletions
|
|
@ -510,3 +510,8 @@
|
||||||
|
|
||||||
- Add inline typst concealing support under `vim.languages.typst` using
|
- Add inline typst concealing support under `vim.languages.typst` using
|
||||||
[typst-concealer].
|
[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.
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,11 @@
|
||||||
lspconfig.tailwindcss.setup {
|
lspconfig.tailwindcss.setup {
|
||||||
capabilities = capabilities;
|
capabilities = capabilities;
|
||||||
on_attach = default_on_attach;
|
on_attach = default_on_attach;
|
||||||
|
settings = {
|
||||||
|
tailwindCSS = {
|
||||||
|
${cfg.lsp.opts}
|
||||||
|
},
|
||||||
|
},
|
||||||
cmd = ${
|
cmd = ${
|
||||||
if isList cfg.lsp.package
|
if isList cfg.lsp.package
|
||||||
then expToLua cfg.lsp.package
|
then expToLua cfg.lsp.package
|
||||||
|
|
@ -49,6 +54,19 @@ in {
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = servers.${cfg.lsp.server}.package;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
opts = mkOption {
|
||||||
|
description = "Options to pass to tailwindcss-lsp";
|
||||||
|
type = str;
|
||||||
|
default = "";
|
||||||
|
example = ''
|
||||||
|
experimental = {
|
||||||
|
classRegex = {
|
||||||
|
{ "cva\\(([^)]*)\\)", "[\"'`]([^\"'`]+)[\"'`]" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue