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

local server_name = 'bashls'

configs[server_name] = {
  default_config = {
    cmd = { 'bash-language-server', 'start' },
    cmd_env = {
      -- Prevent recursive scanning which will cause issues when opening a file
      -- directly in the home directory (e.g. ~/foo.sh).
      --
      -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
      GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
    },
    filetypes = { 'sh' },
    root_dir = util.find_git_ancestor,
    single_file_support = true,
  },
  docs = {
    description = [[
https://github.com/mads-hartmann/bash-language-server

Language server for bash, written using tree sitter in typescript.
]],
    default_config = {
      root_dir = [[util.find_git_ancestor]],
    },
  },
}