aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/yamlls.lua
blob: 3154556d4ce914f6b6a90f7ceb595e4aefd89afc (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
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = 'yamlls'
local bin_name = 'yaml-language-server'

configs[server_name] = {
  default_config = {
    cmd = { bin_name, '--stdio' },
    filetypes = { 'yaml' },
    root_dir = function(fname)
      return util.root_pattern '.git'(fname) or util.path.dirname(fname)
    end,
    settings = {
      -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting
      redhat = { telemetry = { enabled = false } },
    },
  },
  docs = {
    package_json = 'https://raw.githubusercontent.com/redhat-developer/vscode-yaml/master/package.json',
    description = [[
https://github.com/redhat-developer/yaml-language-server

`yaml-language-server` can be installed via `yarn`:
```sh
yarn global add yaml-language-server
```
]],
    default_config = {
      root_dir = [[root_pattern(".git") or dirname]],
    },
  },
}