From 478ac65fd77ac60ab075e068a8f97514b6f6c0ed Mon Sep 17 00:00:00 2001 From: tracer Date: Wed, 1 Apr 2026 22:43:21 +0200 Subject: [PATCH] Stabilize Telescope and trim Mason health checks --- nvim/lua/mason/health.lua | 47 +++++++++++++++++++++++++++++++++++++ nvim/lua/tracer/plugins.lua | 1 + 2 files changed, 48 insertions(+) create mode 100644 nvim/lua/mason/health.lua diff --git a/nvim/lua/mason/health.lua b/nvim/lua/mason/health.lua new file mode 100644 index 0000000..57be87e --- /dev/null +++ b/nvim/lua/mason/health.lua @@ -0,0 +1,47 @@ +local health = vim.health or require("health") + +local M = {} + +local report_start = health.start or health.report_start +local report_ok = health.ok or health.report_ok +local report_warn = health.warn or health.report_warn + +local function check_executable(name, command, advice) + if vim.fn.executable(command) == 1 then + report_ok(("%s: available"):format(name)) + else + report_warn(("%s: not available"):format(name), advice and { advice } or {}) + end +end + +local function check_php() + local php_version = vim.fn.system({ "php", "-r", "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;" }) + if vim.v.shell_error ~= 0 then + report_warn("PHP: not available", { + "Required for your configured Intelephense language server.", + }) + return + end + + php_version = vim.trim(php_version) + if php_version:match("^8%.") then + report_ok(("PHP: `%s`"):format(php_version)) + else + report_warn(("PHP: `%s`"):format(php_version), { + "PHP 8.x is recommended for your configured Intelephense language server.", + }) + end +end + +function M.check() + report_start("mason.nvim") + report_ok("Using local health override to skip unused language runtimes.") + report_ok("Skipped checks for Go, Rust/Cargo, LuaRocks, and Java.") + + report_start("mason.nvim [Required runtimes]") + check_executable("node", "node", "Required for your configured TypeScript, ESLint, HTML, CSS, Emmet, and Intelephense language servers.") + check_executable("npm", "npm", "Required to install and manage the Mason packages used by your configured language servers.") + check_php() +end + +return M diff --git a/nvim/lua/tracer/plugins.lua b/nvim/lua/tracer/plugins.lua index ae50c14..c08030c 100644 --- a/nvim/lua/tracer/plugins.lua +++ b/nvim/lua/tracer/plugins.lua @@ -191,6 +191,7 @@ require("packer").startup(function(use) -- Fuzzy finder use({ "nvim-telescope/telescope.nvim", + tag = "0.2.2", requires = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons",