mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
added ocaml extra
This commit is contained in:
parent
1ceac32652
commit
d1fffee3e3
1 changed files with 40 additions and 0 deletions
40
lua/lazyvim/plugins/extras/lang/ocaml.lua
Normal file
40
lua/lazyvim/plugins/extras/lang/ocaml.lua
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
return {
|
||||||
|
recommended = function()
|
||||||
|
return LazyVim.extras.wants({
|
||||||
|
ft = { "ml", "mli", "cmi", "cmo", "cmx", "cma", "cmxa", "cmxs", "cmt", "cmti", "opam" },
|
||||||
|
root = { "merlin.opam", "dune-project" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
if type(opts.ensure_installed) == "table" then
|
||||||
|
vim.list_extend(opts.ensure_installed, { "ocaml" })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
ocamllsp = {
|
||||||
|
get_language_id = function(_, ftype)
|
||||||
|
return ftype
|
||||||
|
end,
|
||||||
|
root_dir = function(fname)
|
||||||
|
return require("lspconfig.util").root_pattern(
|
||||||
|
"*.opam",
|
||||||
|
"esy.json",
|
||||||
|
"package.json",
|
||||||
|
".git",
|
||||||
|
"dune-project",
|
||||||
|
"dune-workspace",
|
||||||
|
"*.ml"
|
||||||
|
)(fname)
|
||||||
|
end,
|
||||||
|
on_attach = on_attach,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue