aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/ansiblels.lua
blob: b5ccb08633572731cbc8342df529cf4d505ee911 (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
38
39
40
41
42
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
local server_name = 'ansiblels'

configs[server_name] = {
  default_config = {
    cmd = { 'ansible-language-server', '--stdio' },
    settings = {
      ansible = {
        python = {
          interpreterPath = 'python',
        },
        ansibleLint = {
          path = 'ansible-lint',
          enabled = true,
        },
        ansible = {
          path = 'ansible',
        },
        executionEnvironment = {
          enabled = false,
        },
      },
    },
    filetypes = { 'yaml' },
    root_dir = function(fname)
      return util.root_pattern { '*.yml', '*.yaml' }(fname)
    end,
  },
  docs = {
    description = [[
https://github.com/ansible/ansible-language-server

Language server for the ansible configuration management tool.

`ansible-language-server` can be installed via `yarn`:
```sh
yarn global add ansible-language-server
```
]],
  },
}