feat: initial blink-cmp-ssh implementation
Problem: the existing blink-cmp-sshconfig plugin uses a synchronous, build-time Python scraping approach that requires uv and make to generate a static Lua file. Solution: implement a runtime, async blink.cmp source that parses ssh_config keywords from man ssh_config and enum values from ssh -Q queries, matching the architecture of blink-cmp-tmux and blink-cmp-ghostty.
This commit is contained in:
parent
01d8b4eb5e
commit
ad6c683052
28 changed files with 1158 additions and 0 deletions
36
lua/blink-cmp-ssh/health.lua
Normal file
36
lua/blink-cmp-ssh/health.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
local M = {}
|
||||
|
||||
function M.check()
|
||||
vim.health.start('blink-cmp-ssh')
|
||||
|
||||
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('ssh')
|
||||
if bin ~= '' then
|
||||
vim.health.ok('ssh executable found: ' .. bin)
|
||||
else
|
||||
vim.health.error('ssh executable not found')
|
||||
return
|
||||
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 (keyword descriptions will be unavailable)')
|
||||
end
|
||||
|
||||
local result = vim.system({ 'ssh', '-Q', 'cipher' }):wait()
|
||||
if result.code == 0 and result.stdout and result.stdout ~= '' then
|
||||
vim.health.ok('ssh -Q cipher produces output')
|
||||
else
|
||||
vim.health.warn('ssh -Q cipher failed (enum completions will be unavailable)')
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
16
lua/blink-cmp-ssh/types.lua
Normal file
16
lua/blink-cmp-ssh/types.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
---@class blink.cmp.Source
|
||||
|
||||
---@class blink.cmp.CompletionItem
|
||||
---@field label string
|
||||
---@field kind? integer
|
||||
---@field documentation? {kind: string, value: string}
|
||||
---@field filterText? string
|
||||
|
||||
---@class blink.cmp.Context
|
||||
---@field line string
|
||||
---@field cursor integer[]
|
||||
|
||||
---@class blink.cmp.CompletionResponse
|
||||
---@field is_incomplete_forward? boolean
|
||||
---@field is_incomplete_backward? boolean
|
||||
---@field items blink.cmp.CompletionItem[]
|
||||
Loading…
Add table
Add a link
Reference in a new issue