fix: capture inline description for keywords like Host and User
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
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

Problem: keywords with description text on the same line (e.g.
"Host    Restricts the following...") had their first line of
documentation silently dropped because the parser started collecting
at the line after the keyword.

Solution: extract trailing text from the keyword line and prepend it
to the description block.
This commit is contained in:
Barrett Ruth 2026-02-22 21:28:53 -05:00
parent ff0b4ee048
commit 679a4bf804
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 20 additions and 1 deletions

View file

@ -146,6 +146,21 @@ describe('blink-cmp-ssh', function()
assert.is_truthy(strict.documentation.value:find('known_hosts'))
end)
it('includes inline description for keywords with text on the same line', function()
restores[#restores + 1] = mock_system()
local source = require('blink-cmp-ssh').new()
local items
source:get_completions({ line = '', cursor = { 1, 0 } }, function(response)
items = response.items
end)
local host = vim.iter(items):find(function(item)
return item.label == 'Host'
end)
assert.is_not_nil(host)
assert.is_not_nil(host.documentation)
assert.is_truthy(host.documentation.value:find('Restricts'))
end)
it('returns enum values after a known keyword', function()
restores[#restores + 1] = mock_system()
local source = require('blink-cmp-ssh').new()