feat: OCAML support
This commit is contained in:
1 parent
e76bf33934
commit
c1eb78da9c
3 files changed
+86
-67
No files matched your search
@@ -0,0 +1,16 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ OCAML │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("ocamllsp", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("ocamllsp")
|
||||||
@@ -1,56 +1,58 @@
|
|||||||
return {
|
return {
|
||||||
-- lsp package manager
|
-- lsp package manager
|
||||||
"mason-org/mason.nvim",
|
"mason-org/mason.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"mason-org/mason-lspconfig.nvim",
|
"mason-org/mason-lspconfig.nvim",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- import mason
|
-- import mason
|
||||||
local mason = require("mason")
|
local mason = require("mason")
|
||||||
|
|
||||||
-- import mason-lspconfig
|
-- import mason-lspconfig
|
||||||
local mason_lspconfig = require("mason-lspconfig")
|
local mason_lspconfig = require("mason-lspconfig")
|
||||||
|
|
||||||
-- enable mason and configure icons
|
-- enable mason and configure icons
|
||||||
mason.setup({
|
mason.setup({
|
||||||
ui = {
|
ui = {
|
||||||
icons = {
|
icons = {
|
||||||
package_installed = "✔",
|
package_installed = "✔",
|
||||||
package_pending = "➜",
|
package_pending = "➜",
|
||||||
package_uninstalled = "✗",
|
package_uninstalled = "✗",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- list of servers for mason to install
|
-- list of servers for mason to install
|
||||||
mason_lspconfig.setup({
|
mason_lspconfig.setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"asm_lsp",
|
"asm_lsp",
|
||||||
"bashls",
|
"bashls",
|
||||||
"clangd",
|
"clangd",
|
||||||
"cssls",
|
"cssls",
|
||||||
"docker_language_server",
|
"docker_language_server",
|
||||||
"gh_actions_ls",
|
"gh_actions_ls",
|
||||||
"gopls",
|
"gopls",
|
||||||
"html",
|
"html",
|
||||||
"hls",
|
"hls",
|
||||||
"hyprls",
|
"hyprls",
|
||||||
"intelephense",
|
"intelephense",
|
||||||
"jdtls",
|
"jdtls",
|
||||||
"jsonls",
|
"jsonls",
|
||||||
"marksman",
|
"marksman",
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
|
"ocaml-lsp",
|
||||||
|
"ocamlformat",
|
||||||
"postgres_lsp",
|
"postgres_lsp",
|
||||||
"pyright",
|
"pyright",
|
||||||
"rust_analyzer",
|
"rust_analyzer",
|
||||||
-- "ruby_lsp",
|
-- "ruby_lsp",
|
||||||
"verible",
|
"verible",
|
||||||
"vtsls",
|
"vtsls",
|
||||||
"vue_ls",
|
"vue_ls",
|
||||||
"yamlls"
|
"yamlls",
|
||||||
},
|
},
|
||||||
-- auto-install configured servers (with lspconfig)
|
-- auto-install configured servers (with lspconfig)
|
||||||
automatic_enable = false,
|
automatic_enable = false,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
@@ -12,12 +12,17 @@ return {
|
|||||||
|
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.formatting.stylua.with({
|
null_ls.builtins.formatting.asmfmt,
|
||||||
extra_args = {
|
null_ls.builtins.formatting.black,
|
||||||
'--indent-type',
|
null_ls.builtins.formatting.clang_format,
|
||||||
'Spaces'
|
null_ls.builtins.formatting.dart_format,
|
||||||
}
|
require("none-ls.diagnostics.eslint_d"),
|
||||||
}),
|
require("none-ls.code_actions.eslint_d"),
|
||||||
|
require("none-ls.formatting.eslint_d").with( {
|
||||||
|
timeout = 4000
|
||||||
|
} ),
|
||||||
|
null_ls.builtins.formatting.ocamlformat,
|
||||||
|
null_ls.builtins.formatting.phpcbf,
|
||||||
null_ls.builtins.formatting.prettier.with({
|
null_ls.builtins.formatting.prettier.with({
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"css",
|
"css",
|
||||||
@@ -56,18 +61,14 @@ return {
|
|||||||
"true",
|
"true",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
null_ls.builtins.formatting.shfmt,
|
|
||||||
null_ls.builtins.formatting.phpcbf,
|
|
||||||
null_ls.builtins.formatting.asmfmt,
|
|
||||||
null_ls.builtins.code_actions.proselint,
|
null_ls.builtins.code_actions.proselint,
|
||||||
null_ls.builtins.formatting.dart_format,
|
null_ls.builtins.formatting.shfmt,
|
||||||
require("none-ls.diagnostics.eslint_d"),
|
null_ls.builtins.formatting.stylua.with({
|
||||||
require("none-ls.code_actions.eslint_d"),
|
extra_args = {
|
||||||
require("none-ls.formatting.eslint_d").with( {
|
'--indent-type',
|
||||||
timeout = 4000
|
'Spaces'
|
||||||
} ),
|
}
|
||||||
null_ls.builtins.formatting.black,
|
}),
|
||||||
null_ls.builtins.formatting.clang_format
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in new issue
Block a user