From 695ff4aa46bdf77f67d1643d4abd6ea10b665d4c Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 20 Feb 2026 20:18:49 -0500 Subject: [PATCH] feat: add healthcheck Problem: users had no way to diagnose why completions were missing or incomplete. Solution: add a :checkhealth module that verifies blink.cmp is installed, tmux is on PATH and responds to list-commands, and man is available for command descriptions. --- lua/blink-cmp-tmux/health.lua | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lua/blink-cmp-tmux/health.lua diff --git a/lua/blink-cmp-tmux/health.lua b/lua/blink-cmp-tmux/health.lua new file mode 100644 index 0000000..86839e3 --- /dev/null +++ b/lua/blink-cmp-tmux/health.lua @@ -0,0 +1,36 @@ +local M = {} + +function M.check() + vim.health.start('blink-cmp-tmux') + + local ok = pcall(require, 'blink.cmp') + if ok then + vim.health.ok('blink.cmp is installed') + else + vim.health.error('blink.cmp is not installed') + end + + local bin = vim.fn.exepath('tmux') + if bin ~= '' then + vim.health.ok('tmux executable found: ' .. bin) + else + vim.health.error('tmux executable not found') + return + end + + local result = vim.system({ 'tmux', 'list-commands' }):wait() + if result.code == 0 and result.stdout and result.stdout ~= '' then + vim.health.ok('tmux list-commands produces output') + else + vim.health.warn('tmux list-commands failed (completions will be unavailable)') + end + + local man_bin = vim.fn.exepath('man') + if man_bin ~= '' then + vim.health.ok('man executable found: ' .. man_bin) + else + vim.health.warn('man executable not found (command descriptions will be unavailable)') + end +end + +return M