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 Jul 31, 2022
1 parent 7bec4b4 commit 321d65b
Show file tree
Hide file tree
Showing 2 changed files with 28 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

0 comments on commit 321d65b

Please sign in to comment.