diff options
| author | Pau Ruiz Safont <unduthegun@gmail.com> | 2021-05-17 09:54:16 +0100 |
|---|---|---|
| committer | Pau Ruiz Safont <unduthegun@gmail.com> | 2021-05-17 20:59:56 +0100 |
| commit | dcbed9b838d9a180860a28d95781dd82737a485e (patch) | |
| tree | 4379b0eb0eef240cf315585d1e515ffd64b4c5d7 /lua | |
| parent | [docgen] Update CONFIG.md (diff) | |
| download | nvim-lspconfig-dcbed9b838d9a180860a28d95781dd82737a485e.tar nvim-lspconfig-dcbed9b838d9a180860a28d95781dd82737a485e.tar.gz nvim-lspconfig-dcbed9b838d9a180860a28d95781dd82737a485e.tar.bz2 nvim-lspconfig-dcbed9b838d9a180860a28d95781dd82737a485e.tar.lz nvim-lspconfig-dcbed9b838d9a180860a28d95781dd82737a485e.tar.xz nvim-lspconfig-dcbed9b838d9a180860a28d95781dd82737a485e.tar.zst nvim-lspconfig-dcbed9b838d9a180860a28d95781dd82737a485e.zip | |
ocamllsp: prepare for filetype to language_id translation
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/ocamllsp.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lua/lspconfig/ocamllsp.lua b/lua/lspconfig/ocamllsp.lua index 155ec1c8..c588b39d 100644 --- a/lua/lspconfig/ocamllsp.lua +++ b/lua/lspconfig/ocamllsp.lua @@ -1,11 +1,25 @@ local configs = require 'lspconfig/configs' local util = require 'lspconfig/util' +local language_id_of = { + ocaml = 'ocaml'; + reason = 'reason'; +} + +local filetypes = {} + +for ftype, _ in pairs(language_id_of) do + table.insert(filetypes, ftype) +end + +local get_language_id = function (_, ftype) return language_id_of[ftype] end + configs.ocamllsp = { default_config = { cmd = {"ocamllsp",}; - filetypes = {'ocaml', 'reason'}; + filetypes = filetypes; root_dir = util.root_pattern("*.opam", "esy.json", "package.json", ".git"); + get_language_id = get_language_id; }; docs = { description = [[ |
