diff --git a/lua/doom/modules/langs/ocaml/init.lua b/lua/doom/modules/langs/ocaml/init.lua new file mode 100644 index 000000000..b4ae0da88 --- /dev/null +++ b/lua/doom/modules/langs/ocaml/init.lua @@ -0,0 +1,26 @@ +local ocaml = {} + +ocaml.settings = { + language_server_name = "ocamllsp", +} + +ocaml.autocmds = { + { + "Filetype", + "ocaml,ocaml_interface,ocamllex", + function() + local langs_utils = require("doom.modules.langs.utils") + langs_utils.use_lsp(doom.langs.ocaml.settings.language_server_name) + + vim.schedule(function() + require("nvim-treesitter.install").ensure_installed("ocaml","ocaml_interface") + if vim.fn.executable("tree-sitter-cli") == 1 then + require("nvim-treesitter.install").ensure_installed("ocamllex") + end + end) + end, + once = true, + }, +} + +return ocaml diff --git a/modules.lua b/modules.lua index 02788e036..493388920 100644 --- a/modules.lua +++ b/modules.lua @@ -72,6 +72,7 @@ return { -- Compiled -- "rust", -- "cc", + -- "ocaml", -- JIT -- "c_sharp", diff --git a/tools/Dockerfile b/tools/Dockerfile index 4f972c2b2..cb311e5cf 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -33,6 +33,9 @@ RUN pacman -Sy wget unzip make --noconfirm # Required for watching Doom-nvim-contrib for changes RUN npm i -g chokidar-cli +# Required for OCaml language +# RUN pacman -Sy opam diffutils patch ocaml --noconfirm + # Create the doom user and group RUN groupadd doom RUN useradd -m -g doom doom @@ -43,6 +46,9 @@ RUN chown -R ${UNAME}:${GNAME} /usr/local/lib/node_modules/ USER doom WORKDIR /home/doom +# Required for OCaml language +# RUN opam init --disable-sandboxing && opam install ocaml-lsp-server -y + COPY _docker_entry.sh /usr/local/bin/ # Doom-nvim-contrib