aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2025-05-24 18:29:51 +0200
committerGitHub <noreply@github.com>2025-05-24 18:29:51 +0200
commitd24b3f1612e53f9d54d866b16bedab51813f2bf1 (patch)
tree93d3d1ccac94574d1c54d41f30bfda4a53b15903 /lua
parentfix: rename `volar` to `vue_ls` (#561) (diff)
downloadmason-lspconfig-d24b3f1612e53f9d54d866b16bedab51813f2bf1.tar
mason-lspconfig-d24b3f1612e53f9d54d866b16bedab51813f2bf1.tar.gz
mason-lspconfig-d24b3f1612e53f9d54d866b16bedab51813f2bf1.tar.bz2
mason-lspconfig-d24b3f1612e53f9d54d866b16bedab51813f2bf1.tar.lz
mason-lspconfig-d24b3f1612e53f9d54d866b16bedab51813f2bf1.tar.xz
mason-lspconfig-d24b3f1612e53f9d54d866b16bedab51813f2bf1.tar.zst
mason-lspconfig-d24b3f1612e53f9d54d866b16bedab51813f2bf1.zip
feat(health): add healthcheck (#564)
Diffstat (limited to 'lua')
-rw-r--r--lua/mason-lspconfig/health.lua13
-rw-r--r--lua/mason-lspconfig/init.lua6
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