From 23ed2e99648b807a8b7e1adee4cf587f642a2828 Mon Sep 17 00:00:00 2001 From: Martin Larsson Date: Wed, 30 Oct 2024 17:46:54 +0100 Subject: [PATCH] Light refactoring to mason/lsp setup, also add support to zig, ocaml, and go. --- home/.config/nvim/lua/plugs/mason_lsp.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/home/.config/nvim/lua/plugs/mason_lsp.lua b/home/.config/nvim/lua/plugs/mason_lsp.lua index a76fbba..ccb937f 100644 --- a/home/.config/nvim/lua/plugs/mason_lsp.lua +++ b/home/.config/nvim/lua/plugs/mason_lsp.lua @@ -207,18 +207,32 @@ return { -- Get an array of all the files in the directory, make sure to account for single file local lua_files = has_line_breaks and vim.fn.split(lua_files_str, "\n") or { lua_files_str } -- Remove path and extension and only keep the filename - local server_names = vim.tbl_map(function(file) + local custom_server_confs = vim.tbl_map(function(file) return vim.fn.fnamemodify(file, ":t:r") end, lua_files) - -- Create a new table which contains the non-lsp setups for Mason (linters, formatters, etc) + -- Combine the default servers with the custom ones + local server_names = vim.list_extend({ + "bashls", + "cmake", + "lua_ls", + "yamlls", + "zls", + -- "ocamllsp", + "gopls", + }, custom_server_confs) + + -- Create a new table which contains the non LSP Mason installees. -- IMPORTANT: Make sure to leave rust-analyzer out of this list, as it can cause conflicts with rustaceanvim. -- Install rust-analyzer using your systems package manager instead. local mason_installs = vim.list_extend({ "clang-format", - "cmakelang", "codelldb", "netcoredbg", + "delve", + "golangci-lint", + -- "ocamlearlybird", + -- "ocamlformat", }, server_names) require("mason").setup()