From d500455f076a542be627f376b6a3b1aaf46221ca Mon Sep 17 00:00:00 2001 From: Georgy Komarov Date: Sat, 28 Mar 2020 16:39:10 +0300 Subject: Add ocaml-lsp support --- lua/nvim_lsp/ocamllsp.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lua/nvim_lsp/ocamllsp.lua diff --git a/lua/nvim_lsp/ocamllsp.lua b/lua/nvim_lsp/ocamllsp.lua new file mode 100644 index 00000000..9e426aba --- /dev/null +++ b/lua/nvim_lsp/ocamllsp.lua @@ -0,0 +1,28 @@ +local configs = require 'nvim_lsp/configs' +local util = require 'nvim_lsp/util' + +configs.ocamllsp = { + default_config = { + cmd = {"ocamllsp",}; + filetypes = {'ocaml', 'reason'}; + root_dir = function(fname) + return util.find_git_ancestor(fname) or vim.loop.os_homedir() + end; + }; + docs = { + description = [[ +https://github.com/ocaml/ocaml-lsp + +`ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). + +To install the lsp server in a particular opam switch: +```sh +opam pin add ocaml-lsp-server https://github.com/ocaml/ocaml-lsp.git +opam install ocaml-lsp-server +``` + ]]; + default_config = { + root_dir = [[root_pattern(".merlin", "package.json")]]; + }; + }; +} -- cgit v1.2.3-70-g09d2 From c3a70c82642d92c729672e8148cdef682463a184 Mon Sep 17 00:00:00 2001 From: Georgy Komarov Date: Sun, 29 Mar 2020 07:45:22 +0300 Subject: Update lua/nvim_lsp/ocamllsp.lua Co-Authored-By: Hirokazu Hata --- lua/nvim_lsp/ocamllsp.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/nvim_lsp/ocamllsp.lua b/lua/nvim_lsp/ocamllsp.lua index 9e426aba..11393893 100644 --- a/lua/nvim_lsp/ocamllsp.lua +++ b/lua/nvim_lsp/ocamllsp.lua @@ -5,9 +5,7 @@ configs.ocamllsp = { default_config = { cmd = {"ocamllsp",}; filetypes = {'ocaml', 'reason'}; - root_dir = function(fname) - return util.find_git_ancestor(fname) or vim.loop.os_homedir() - end; + root_dir = util.root_pattern("merlin", "package.json", ".git"); }; docs = { description = [[ -- cgit v1.2.3-70-g09d2