local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() local default_setup = function(server) require("lspconfig")[server].setup({ capabilities = lsp_capabilities, }) end -- enable mason and configure icons require("mason").setup({ ui = { icons = { package_installed = "✓", package_pending = "➜", package_uninstalled = "✗", }, }, }) require("mason-lspconfig").setup({ ensure_installed = { "tsserver", "cssls", "html", "bashls", "eslint", "marksman", --"lua_ls" has to be installed via package manager on ARM systems }, handlers = { default_setup, }, }) local lspconfig = require("lspconfig") require("mason-lspconfig").setup_handlers({ -- The first entry (without a key) will be the default handler -- and will be called for each installed server that doesn't have -- a dedicated handler. function(server_name) require("lspconfig")[server_name].setup({ on_attach = on_attach, capabilities = capabilities, --handlers = handlers, }) end, ["eslint"] = function() lspconfig.eslint.setup({ capabilities = capabilities, --handlers = handlers, on_attach = require("config.lsp.servers.eslint").on_attach, settings = require("config.lsp.servers.eslint").settings, }) end, ["lua_ls"] = function() lspconfig.lua_ls.setup({ capabilities = capabilities, on_attach = require("config.lsp.servers.lua").on_attach, settings = require("config.lsp.servers.lua").settings, }) end })