diff options
author | Raphael <glepnir@neovim.pro> | 2023-06-05 13:17:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-05 07:17:38 +0200 |
commit | 3c6d971e5488dc75b7db07c14d01f87827f28a67 (patch) | |
tree | 97b4b2dfb8898dc30a54d4ec44bc6213c5569531 /runtime/lua/vim/lsp/util.lua | |
parent | cc41697775b0ea4a41a4f82a9e466123d4a2d77f (diff) | |
download | rneovim-3c6d971e5488dc75b7db07c14d01f87827f28a67.tar.gz rneovim-3c6d971e5488dc75b7db07c14d01f87827f28a67.tar.bz2 rneovim-3c6d971e5488dc75b7db07c14d01f87827f28a67.zip |
fix(lsp): set extra info only when it has a value (#23868)
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 11 |
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, |