mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
fix(lsp): set extra info only when it has a value (#23868)
This commit is contained in:
@@ -716,15 +716,18 @@ function M.text_document_completion_list_to_complete_items(result, prefix)
|
||||
local matches = {}
|
||||
|
||||
for _, completion_item in ipairs(items) do
|
||||
local info = ' '
|
||||
local info = ''
|
||||
local documentation = completion_item.documentation
|
||||
if documentation then
|
||||
if type(documentation) == 'string' and documentation ~= '' then
|
||||
info = documentation
|
||||
elseif type(documentation) == 'table' and type(documentation.value) == 'string' then
|
||||
info = documentation.value
|
||||
-- else
|
||||
-- TODO(ashkan) Validation handling here?
|
||||
else
|
||||
vim.notify(
|
||||
('invalid documentation value %s'):format(vim.inspect(documentation)),
|
||||
vim.log.levels.WARN
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -734,7 +737,7 @@ function M.text_document_completion_list_to_complete_items(result, prefix)
|
||||
abbr = completion_item.label,
|
||||
kind = M._get_completion_item_kind_name(completion_item.kind),
|
||||
menu = completion_item.detail or '',
|
||||
info = info,
|
||||
info = #info > 0 and info or nil,
|
||||
icase = 1,
|
||||
dup = 1,
|
||||
empty = 1,
|
||||
|
||||
Reference in New Issue
Block a user