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

Commit 50bb8d1

Browse files
authored
feat(langs,ocaml): add language (#373)
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>
1 parent 8506cbc commit 50bb8d1

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
local ocaml = {}
2+
3+
ocaml.settings = {
4+
language_server_name = "ocamllsp",
5+
}
6+
7+
ocaml.autocmds = {
8+
{
9+
"Filetype",
10+
"ocaml,ocaml_interface,ocamllex",
11+
function()
12+
local langs_utils = require("doom.modules.langs.utils")
13+
langs_utils.use_lsp(doom.langs.ocaml.settings.language_server_name)
14+
15+
vim.schedule(function()
16+
require("nvim-treesitter.install").ensure_installed("ocaml","ocaml_interface")
17+
if vim.fn.executable("tree-sitter-cli") == 1 then
18+
require("nvim-treesitter.install").ensure_installed("ocamllex")
19+
end
20+
end)
21+
end,
22+
once = true,
23+
},
24+
}
25+
26+
return ocaml

modules.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ return {
7272
-- Compiled
7373
-- "rust",
7474
-- "cc",
75+
-- "ocaml",
7576

7677
-- JIT
7778
-- "c_sharp",

tools/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ RUN pacman -Sy wget unzip make --noconfirm
3333
# Required for watching Doom-nvim-contrib for changes
3434
RUN npm i -g chokidar-cli
3535

36+
# Required for OCaml language
37+
# RUN pacman -Sy opam diffutils patch ocaml --noconfirm
38+
3639
# Create the doom user and group
3740
RUN groupadd doom
3841
RUN useradd -m -g doom doom
@@ -43,6 +46,9 @@ RUN chown -R ${UNAME}:${GNAME} /usr/local/lib/node_modules/
4346
USER doom
4447
WORKDIR /home/doom
4548

49+
# Required for OCaml language
50+
# RUN opam init --disable-sandboxing && opam install ocaml-lsp-server -y
51+
4652
COPY _docker_entry.sh /usr/local/bin/
4753

4854
# Doom-nvim-contrib

0 commit comments

Comments
 (0)