-- Bridges Mason and lspconfig: auto-installs and enables language servers.
-- Injects nvim-cmp capabilities globally so all LSP servers support enhanced completions.
return {
	"williamboman/mason-lspconfig.nvim",
	dependencies = {
		"williamboman/mason.nvim",
		"neovim/nvim-lspconfig",
		"hrsh7th/cmp-nvim-lsp", -- Required for completion capabilities
	},
	config = function()
		local capabilities = require("cmp_nvim_lsp").default_capabilities()
		vim.lsp.config("*", {
			capabilities = capabilities,
		})
		require("mason-lspconfig").setup({
			automatic_installation = true,
			automatic_enable = true,
		})
	end,
}
