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 8506cbc commit d249c65
Show file tree
Hide file tree
Showing 3 changed files with 33 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
1 change: 1 addition & 0 deletions modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ return {
-- Compiled
-- "rust",
-- "cc",
-- "ocaml",

-- JIT
-- "c_sharp",
Expand Down
6 changes: 6 additions & 0 deletions tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d249c65

Please sign in to comment.