diff options
Diffstat (limited to 'lsp/foam_ls.lua')
| -rw-r--r-- | lsp/foam_ls.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lsp/foam_ls.lua b/lsp/foam_ls.lua new file mode 100644 index 00000000..e257bc09 --- /dev/null +++ b/lsp/foam_ls.lua @@ -0,0 +1,22 @@ +local util = require 'lspconfig.util' + +---@brief +--- +---https://github.com/FoamScience/foam-language-server +-- +-- `foam-language-server` can be installed via `npm` +-- ```sh +-- npm install -g foam-language-server +-- ``` +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(util.search_ancestors(fname, function(path) + if vim.uv.fs_stat(path .. '/system/controlDict') then + return path + end + end)) + end, +} |
