Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
feat(ocaml): add language
Browse files Browse the repository at this point in the history
Uses https://ocaml.org/p/ocaml-lsp-server/ as language server that can
be installed via `opam`.

Signed-off-by: Edwin Török <edwin@etorok.net>
  • Loading branch information
edwintorok committed Aug 1, 2022
1 parent 7bec4b4 commit ae19580
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lua/doom/modules/langs/ocaml/init.lua
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ return {
-- "config", -- JSON, YAML, TOML
-- "markdown",
-- "terraform", -- Terraform / hcl files support

-- "ocaml"
}
}

Expand Down
6 changes: 6 additions & 0 deletions tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ RUN pacman -Sy wget unzip
# 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
Expand All @@ -40,6 +43,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
Expand Down

0 comments on commit ae19580

Please sign in to comment.