From 1888f32088a5303c07d009b283f58b6b6a1e130b Mon Sep 17 00:00:00 2001 From: Oleksiy Hryshchenko Date: Tue, 11 Apr 2023 17:04:12 +0300 Subject: [PATCH] fix description and missing code in ShowCompletionDocumentation() --- autoload/lsp/completion.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(['- - -']) -- 2.48.1