LanguageClient: Show markdown tool tips as plain text

We tell the language server that we do not support markdown, but some
(haskell-ide-engine) ignore that.
Show the text as plain text.

Change-Id: I1a61346b497cc04dce6c0da4221e949a16c61acf
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2019-10-25 10:45:27 +02:00
parent 7f0654e35c
commit 3476dbd560

View File

@@ -126,10 +126,13 @@ void HoverHandler::setContent(const HoverContent &hoverContent)
{
if (auto markupContent = Utils::get_if<MarkupContent>(&hoverContent)) {
const QString &content = markupContent->content();
if (markupContent->kind() == MarkupKind::plaintext)
if (markupContent->kind() == MarkupKind::plaintext) {
setToolTip(content);
else if (m_client)
m_client->log(tr("Got unsupported markup hover content: ") + content);
} else if (m_client) {
m_client->log(tr("Got unsupported markup hover content: ") + content,
Core::MessageManager::Silent);
setToolTip(content);
}
} else if (auto markedString = Utils::get_if<MarkedString>(&hoverContent)) {
setToolTip(toolTipForMarkedStrings({*markedString}));
} else if (auto markedStrings = Utils::get_if<QList<MarkedString>>(&hoverContent)) {