diff --git a/nvim/lua/plugins/lsp/ls/ocaml.lua b/nvim/lua/plugins/lsp/ls/ocaml.lua new file mode 100644 index 0000000..b4ce34a --- /dev/null +++ b/nvim/lua/plugins/lsp/ls/ocaml.lua @@ -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") diff --git a/nvim/lua/plugins/lsp/mason.lua b/nvim/lua/plugins/lsp/mason.lua index 25fdf5a..3ffb27f 100755 --- a/nvim/lua/plugins/lsp/mason.lua +++ b/nvim/lua/plugins/lsp/mason.lua @@ -1,56 +1,58 @@ return { - -- lsp package manager - "mason-org/mason.nvim", - dependencies = { - "mason-org/mason-lspconfig.nvim", - }, - config = function() - -- import mason - local mason = require("mason") + -- lsp package manager + "mason-org/mason.nvim", + dependencies = { + "mason-org/mason-lspconfig.nvim", + }, + config = function() + -- import mason + local mason = require("mason") - -- import mason-lspconfig - local mason_lspconfig = require("mason-lspconfig") + -- import mason-lspconfig + local mason_lspconfig = require("mason-lspconfig") - -- enable mason and configure icons - mason.setup({ - ui = { - icons = { - package_installed = "✔", - package_pending = "➜", - package_uninstalled = "✗", - }, - }, - }) + -- enable mason and configure icons + mason.setup({ + ui = { + icons = { + package_installed = "✔", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, + }) - -- list of servers for mason to install - mason_lspconfig.setup({ - ensure_installed = { - "asm_lsp", - "bashls", - "clangd", - "cssls", - "docker_language_server", - "gh_actions_ls", - "gopls", - "html", - "hls", - "hyprls", - "intelephense", - "jdtls", - "jsonls", - "marksman", - "lua_ls", + -- list of servers for mason to install + mason_lspconfig.setup({ + ensure_installed = { + "asm_lsp", + "bashls", + "clangd", + "cssls", + "docker_language_server", + "gh_actions_ls", + "gopls", + "html", + "hls", + "hyprls", + "intelephense", + "jdtls", + "jsonls", + "marksman", + "lua_ls", + "ocaml-lsp", + "ocamlformat", "postgres_lsp", - "pyright", - "rust_analyzer", - -- "ruby_lsp", - "verible", - "vtsls", - "vue_ls", - "yamlls" - }, - -- auto-install configured servers (with lspconfig) - automatic_enable = false, - }) - end, + "pyright", + "rust_analyzer", + -- "ruby_lsp", + "verible", + "vtsls", + "vue_ls", + "yamlls", + }, + -- auto-install configured servers (with lspconfig) + automatic_enable = false, + }) + end, } diff --git a/nvim/lua/plugins/lsp/none-ls.lua b/nvim/lua/plugins/lsp/none-ls.lua index c90caed..f3d4e93 100755 --- a/nvim/lua/plugins/lsp/none-ls.lua +++ b/nvim/lua/plugins/lsp/none-ls.lua @@ -12,12 +12,17 @@ return { null_ls.setup({ sources = { - null_ls.builtins.formatting.stylua.with({ - extra_args = { - '--indent-type', - 'Spaces' - } - }), + null_ls.builtins.formatting.asmfmt, + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.clang_format, + 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({ filetypes = { "css", @@ -56,18 +61,14 @@ return { "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.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.black, - null_ls.builtins.formatting.clang_format + null_ls.builtins.formatting.shfmt, + null_ls.builtins.formatting.stylua.with({ + extra_args = { + '--indent-type', + 'Spaces' + } + }), }, }) end,