From: Oleksiy Hryshchenko Date: Tue, 11 Apr 2023 14:04:12 +0000 (+0300) Subject: fix description and missing code in ShowCompletionDocumentation() X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=1888f32088a5303c07d009b283f58b6b6a1e130b;p=vim-lsp.git fix description and missing code in ShowCompletionDocumentation() --- diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index d07cda9..6e805a5 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -248,7 +248,7 @@ export def CompletionReply(lspserver: dict, cItems: any) endif enddef -# process the completion documentation without LSP server request +# process the completion documentation def ShowCompletionDocumentation(cItem: any) if cItem->empty() || cItem->type() != v:t_dict return @@ -268,6 +268,13 @@ def ShowCompletionDocumentation(cItem: any) var infoText: list var infoKind: string + if cItem->has_key('detail') && !cItem.detail->empty() + # Solve a issue where if a server send the detail field with "\n", + # on the completion popup, everything will be joined with "^@" + # (example: typescript-language-server) + infoText->extend(cItem.detail->split("\n")) + endif + if cItem->has_key('documentation') if !infoText->empty() infoText->extend(['- - -'])