diff options
| -rw-r--r-- | lua/mason-lspconfig/health.lua | 13 | ||||
| -rw-r--r-- | lua/mason-lspconfig/init.lua | 6 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lua/mason-lspconfig/health.lua b/lua/mason-lspconfig/health.lua new file mode 100644 index 0000000..c36f8eb --- /dev/null +++ b/lua/mason-lspconfig/health.lua @@ -0,0 +1,13 @@ +local M = {} + +function M.check() + vim.health.start "mason-lspconfig.nvim" + + if vim.fn.has "nvim-0.11" ~= 1 then + vim.health.error "Neovim v0.11 or higher is required." + else + vim.health.ok "Neovim v0.11" + end +end + +return M diff --git a/lua/mason-lspconfig/init.lua b/lua/mason-lspconfig/init.lua index c886285..c734213 100644 --- a/lua/mason-lspconfig/init.lua +++ b/lua/mason-lspconfig/init.lua @@ -7,10 +7,12 @@ local M = {} local function check_and_notify_bad_setup_order() local mason_ok, mason = pcall(require, "mason") local is_bad_order = not mason_ok or mason.has_setup == false - local impacts_functionality = not mason_ok or #settings.current.ensure_installed > 0 + local impacts_functionality = not mason_ok + or #settings.current.ensure_installed > 0 + or settings.current.automatic_enable ~= false if is_bad_order and impacts_functionality then require "mason-lspconfig.notify"( - "mason.nvim has not been set up. Make sure to set up 'mason' before 'mason-lspconfig'. :h mason-lspconfig-quickstart", + "mason.nvim has not been set up. Make sure to set up mason.nvim before mason-lspconfig.nvim. See :h mason-lspconfig-quickstart", vim.log.levels.WARN ) end |
