return { "mason-org/mason.nvim", cmd = "Mason", build = ":MasonUpdate", opts_extend = { "ensure_installed" }, opts = { ensure_installed = { -- Formatters and tools "stylua", -- LSP servers (will be auto-detected by mason-lspconfig) "lua-language-server", "gopls", "pyright" } }, event = "VeryLazy", config = function(_, opts) require("mason").setup(opts) local mr = require("mason-registry") mr.refresh(function() for _, tool in ipairs(opts.ensure_installed) do local p = mr.get_package(tool) if not p:is_installed() then p:install() end end end) end, }