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

return {
  default_config = {
    cmd = { 'foam-ls', '--stdio' },
    filetypes = { 'foam', 'OpenFOAM' },
    root_dir = function(fname)
      return util.search_ancestors(fname, function(path)
        if vim.uv.fs_stat(path .. '/system/controlDict') then
          return path
        end
      end)
    end,
  },
  docs = {
    description = [[
https://github.com/FoamScience/foam-language-server

`foam-language-server` can be installed via `npm`
```sh
npm install -g foam-language-server
```
]],
  },
}