Compare commits

..

2 commits

Author SHA1 Message Date
Barrett Ruth
c0c59d1e57
perf: async parallel cache initialization and remove deepcopy (#6)
Some checks failed
quality / changes (push) Has been cancelled
test / Test (Neovim nightly) (push) Has been cancelled
test / Test (Neovim stable) (push) Has been cancelled
luarocks / quality (push) Has been cancelled
quality / Lua Format Check (push) Has been cancelled
quality / Lua Lint Check (push) Has been cancelled
quality / Lua Type Check (push) Has been cancelled
quality / Markdown Format Check (push) Has been cancelled
luarocks / publish (push) Has been cancelled
Problem: first completion request blocked the UI with three sequential
synchronous vim.system():wait() calls (man page, command names,
command list), and every subsequent completion unnecessarily
deep-copied the entire cache.

Solution: run all three system calls concurrently via vim.system
callbacks, merging results when all complete. Queue pending completion
requests during loading. Return cached items directly instead of
deep-copying.
2026-02-20 20:39:32 -05:00
Barrett Ruth
7003996643
feat: add healthcheck (#7)
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.
2026-02-20 20:36:41 -05:00
4 changed files with 49 additions and 5 deletions

View file

@ -2,6 +2,12 @@
"runtime.version": "Lua 5.1", "runtime.version": "Lua 5.1",
"runtime.path": ["lua/?.lua", "lua/?/init.lua"], "runtime.path": ["lua/?.lua", "lua/?/init.lua"],
"diagnostics.globals": ["vim", "jit"], "diagnostics.globals": ["vim", "jit"],
"diagnostics.disable": [
"undefined-doc-name",
"undefined-doc-class",
"undefined-field",
"need-check-nil"
],
"workspace.library": ["$VIMRUNTIME/lua", "${3rd}/luv/library"], "workspace.library": ["$VIMRUNTIME/lua", "${3rd}/luv/library"],
"workspace.checkThirdParty": false, "workspace.checkThirdParty": false,
"completion.callSnippet": "Replace" "completion.callSnippet": "Replace"

View file

@ -47,7 +47,7 @@ local function parse_descriptions(man_stdout, names_stdout)
local j = def.line + 1 local j = def.line + 1
while j <= block_end do while j <= block_end do
local l = lines[j] local l = lines[j]
if l:match('^%s+%(alias:') then if l:match('^%s+%(alias:') or vim.trim(l) == '' then
j = j + 1 j = j + 1
elseif l:match('^ ') then elseif l:match('^ ') then
local stripped = vim.trim(l) local stripped = vim.trim(l)
@ -56,8 +56,6 @@ local function parse_descriptions(man_stdout, names_stdout)
else else
break break
end end
elseif vim.trim(l) == '' then
j = j + 1
else else
break break
end end
@ -86,7 +84,7 @@ local function parse_descriptions(man_stdout, names_stdout)
end end
end end
local desc = table.concat(parts, '\n\n') local desc = table.concat(parts, '\n\n')
desc = desc:gsub('\xe2\x80\x90 ', '') desc = desc:gsub(string.char(0xe2, 0x80, 0x90) .. ' ', '')
desc = desc:gsub(' +', ' ') desc = desc:gsub(' +', ' ')
if desc ~= '' then if desc ~= '' then
descs[def.cmd] = desc descs[def.cmd] = desc

View file

@ -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

View file

@ -46,7 +46,11 @@ local function mock_system()
on_exit(result) on_exit(result)
return {} return {}
end end
return { wait = function() return result end } return {
wait = function()
return result
end,
}
end end
vim.schedule = function(fn) vim.schedule = function(fn)
fn() fn()