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

feat(ocaml): add language #373

Merged
merged 1 commit into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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