unocss-language-server
v0.1.9
Published
unocss language server
Downloads
466
Readme
UnoCSS Language Server
A language server for unocss
Features
- Simple completion
- Hover
- Loading config from
root dir - Highlight color (use with mrshmllow/document-color.nvim)
Install
npm i unocss-language-server -gFor Nix users:
# Install
nix profile install github:xna00/unocss-language-server
# or just run without installing
nix run github:xna00/unocss-language-server -- --stdioUsage
nvim-lspconfig server_configuration
require 'lspconfig'.unocss.setup {
on_attach = on_attach,
capabilities = capabilities,
filetypes = { ... },
root_dir = function(fname)
return require 'lspconfig.util'.root_pattern(...)(fname)
end
}If you are using nvim-cmp, you can add - to trigger_characters.
cmp.setup {
sources = { { name = 'nvim_lsp', trigger_characters = { '-' } } }
}Because @unocss/autocomplete suggest less before meeting -.
CoC (coc.nvim)
To use the language server with coc.nvim, add the following to your coc-settings.json.
CoC connects to the server over stdio, so make sure to include the --stdio argument.
{
"languageserver": {
"unocss": {
"command": "unocss-language-server",
"args": [
"--stdio"
],
"filetypes": [
"typescriptreact",
"javascriptreact",
"vue",
"svelte"
]
}
}
}