return { "mason-org/mason-lspconfig.nvim", dependencies = { { "mason-org/mason.nvim", opts = {} }, "neovim/nvim-lspconfig", "saghen/blink.cmp", }, opts = { ensure_installed = { "pyright", "lua_ls", "bashls", "terraformls", "yamlls", "ts_ls", "cssls", "html", "helm_ls", }, -- default true: auto-calls vim.lsp.enable() for every Mason-installed -- server as it finishes installing. }, config = function(_, opts) -- helm_ls's default config only attaches to filetype "helm" / -- "yaml.helm-values" (not plain "yaml"), so without this, -- templates/*.yaml only gets yamlls — which flags Helm's Go template -- syntax ({{ .Values.x }}) as invalid YAML. values.yaml gets the -- composite filetype instead, which both yamlls and helm_ls match, so -- it keeps YAML validation *and* gets helm_ls's values-schema support. vim.filetype.add({ pattern = { [".*/templates/.*%.ya?ml"] = "helm", [".*/templates/.*%.tpl"] = "helm", [".*/values.*%.ya?ml"] = "yaml.helm-values", }, }) -- Merge blink.cmp's LSP capabilities into every server's default config -- (Mason-managed or not) before any server gets enabled. vim.lsp.config("*", { capabilities = require("blink.cmp").get_lsp_capabilities(), }) require("mason-lspconfig").setup(opts) -- clangd ships with Xcode Command Line Tools already, so it's not -- Mason-managed — nvim-lspconfig provides its default config, we just -- need to turn it on. vim.lsp.enable("clangd") end, }