aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/cssls.lua
blob: 25e6e8578ece02a3664f2a646f0e24126af72c9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "cssls"
local bin_name = "css-languageserver"

local root_pattern = util.root_pattern("package.json")

configs[server_name] = {
  default_config = {
    cmd = {bin_name, "--stdio"};
    filetypes = {"css", "scss", "less"};
    root_dir = function(fname)
      return root_pattern(fname) or vim.loop.os_homedir()
    end;
    settings = {
      css = { validate = true },
      scss = { validate = true },
      less = { validate = true }
     };
  };
  docs = {
    description = [[
https://github.com/vscode-langservers/vscode-css-languageserver-bin

`css-languageserver` can be installed via `npm`:
```sh
npm install -g vscode-css-languageserver-bin
```
]];
    default_config = {
      root_dir = [[root_pattern("package.json")]];
    };
  };
}

-- vim:et ts=2 sw=2