aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/configs/fennel_ls.lua
blob: 4726075a1b1678259a29fdaaa0c7ca1e58c63189 (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 util = require 'lspconfig.util'

return {
  default_config = {
    cmd = { 'fennel-ls' },
    filetypes = { 'fennel' },
    root_dir = function(dir)
      local has_fls_project_cfg = function(path)
        local fnlpath = vim.fs.joinpath(path, 'flsproject.fnl')
        return (vim.uv.fs_stat(fnlpath) or {}).type == 'file'
      end
      return util.search_ancestors(dir, has_fls_project_cfg) or vim.fs.root(0, '.git')
    end,
    settings = {},
    single_file_support = true,
    capabilities = {
      offsetEncoding = { 'utf-8', 'utf-16' },
    },
  },
  docs = {
    description = [[
https://sr.ht/~xerool/fennel-ls/

A language server for fennel.

fennel-ls is configured using the closest file to your working directory named `flsproject.fnl`.
All fennel-ls configuration options [can be found here](https://git.sr.ht/~xerool/fennel-ls/tree/HEAD/docs/manual.md#configuration).
]],
  },
}