aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/foam_ls.lua
blob: cff7c03ed7e3a5ea65a6255ca77e87a94a3e194b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---@brief
---
--- https://github.com/FoamScience/foam-language-server
---
--- `foam-language-server` can be installed via `npm`
--- ```sh
--- npm install -g foam-language-server
--- ```

---@type vim.lsp.Config
return {
  cmd = { 'foam-ls', '--stdio' },
  filetypes = { 'foam', 'OpenFOAM' },
  root_dir = function(bufnr, on_dir)
    local fname = vim.api.nvim_buf_get_name(bufnr)
    on_dir(vim.iter(vim.fs.parents(fname)):find(function(path)
      if vim.uv.fs_stat(path .. '/system/controlDict') then
        return path
      end
    end))
  end,
}