autoload/lsp/completion.vim | 9 ++++++++- diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index d07cda9291d35d89df305e7e30610c80bbf06ab1..6e805a59f424c37844dc0e4d5596cf22ec9fc22b 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -248,7 +248,7 @@ lspserver.omniCompletePending = false 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 @@ -267,6 +267,13 @@ endif 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()