From 814c43a0537b82715452d8885907bd815210d687 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 8 Jan 2023 18:59:38 +0100 Subject: [PATCH] refactor(mason): move ensure_installed to opts.ensure_installed --- lua/lazyvim/plugins/lsp/init.lua | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 26a3502e..518c89ee 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -114,17 +114,22 @@ return { "williamboman/mason.nvim", cmd = "Mason", keys = { { "cm", "Mason", desc = "Mason" } }, - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, }, - ---@param opts MasonSettings - config = function(self, opts) + ---@param opts MasonSettings | {ensure_installed: string[]} + config = function(plugin, opts) + if plugin.ensure_installed then + require("lazyvim.util").deprecate("treesitter.ensure_installed", "treesitter.opts.ensure_installed") + end require("mason").setup(opts) local mr = require("mason-registry") - for _, tool in ipairs(self.ensure_installed) do + for _, tool in ipairs(opts.ensure_installed) do local p = mr.get_package(tool) if not p:is_installed() then p:install()