aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorMohammed Elwardi Fadeli <34474472+FoamScience@users.noreply.github.com>2022-01-09 17:33:23 +0100
committerGitHub <noreply@github.com>2022-01-09 08:33:23 -0800
commitceda366985c21cf956ae61a6b9ddc8ab7efd4507 (patch)
tree5c195f11166c4dc3fa89effd3c01be216beea4c6 /lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-ceda366985c21cf956ae61a6b9ddc8ab7efd4507.tar
nvim-lspconfig-ceda366985c21cf956ae61a6b9ddc8ab7efd4507.tar.gz
nvim-lspconfig-ceda366985c21cf956ae61a6b9ddc8ab7efd4507.tar.bz2
nvim-lspconfig-ceda366985c21cf956ae61a6b9ddc8ab7efd4507.tar.lz
nvim-lspconfig-ceda366985c21cf956ae61a6b9ddc8ab7efd4507.tar.xz
nvim-lspconfig-ceda366985c21cf956ae61a6b9ddc8ab7efd4507.tar.zst
nvim-lspconfig-ceda366985c21cf956ae61a6b9ddc8ab7efd4507.zip
feat: add OpenFOAM language server (#1643)
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/server_configurations/foam_ls.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/lua/lspconfig/server_configurations/foam_ls.lua b/lua/lspconfig/server_configurations/foam_ls.lua
new file mode 100644
index 00000000..f10964be
--- /dev/null
+++ b/lua/lspconfig/server_configurations/foam_ls.lua
@@ -0,0 +1,32 @@
+local util = require 'lspconfig.util'
+local bin_name = 'foam-ls'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
+return {
+ default_config = {
+ cmd = cmd,
+ filetypes = { 'foam', 'OpenFOAM' },
+ root_dir = function(fname)
+ return util.search_ancestors(fname, function(path)
+ if util.path.exists(util.path.join(path, 'system', 'controlDict')) then
+ return path
+ end
+ end)
+ end,
+ },
+ docs = {
+ package_json = 'https://raw.githubusercontent.com/FoamScience/foam-language-server/master/package.json',
+ description = [[
+https://github.com/FoamScience/foam-language-server
+
+`foam-language-server` can be installed via `npm`
+```sh
+npm install -g foam-language-server
+```
+]],
+ },
+}