]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
omnifunc documentation popup not throw error
authorGirish Palya <girishji@gmail.com>
Thu, 10 Aug 2023 17:26:34 +0000 (19:26 +0200)
committerGirish Palya <girishji@gmail.com>
Thu, 10 Aug 2023 17:26:34 +0000 (19:26 +0200)
When using Omni completion with other sources of completion items
that do not have 'user_data' dictionary, documentation popup should
not throw error.

I am using my own completion plugin with g:LspOmniFunc and I need
LSP to grab lazy-doc from lsp server. But it should not throw
error when user_data does not contain dictionary.

M  autoload/lsp/completion.vim

autoload/lsp/completion.vim

index bd6094a74be266572a3f5a4df5f799d4f21784e0..3d1c2be3de3db1c510337959d839cc5249a75025 100644 (file)
@@ -538,7 +538,7 @@ def LspResolve()
 
   var item = v:event.completed_item
   if item->has_key('user_data') && !item.user_data->empty()
-      if !item.user_data->has_key('documentation')
+      if item.user_data->type() == v:t_dict && !item.user_data->has_key('documentation')
        lspserver.resolveCompletion(item.user_data)
       else
        ShowCompletionDocumentation(item.user_data)