aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/lsp/util.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index ba8c72128e..e36014d07d 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -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,