Commit e554505e authored by Olivier Goffart's avatar Olivier Goffart

lspclient: Use the label when insertText or sortText is missing

The spec for these fields say: "When `falsy` the label is used."

Differential Revision: https://phabricator.kde.org/D22348
parent 2fdd8c14
......@@ -756,7 +756,11 @@ parseDocumentCompletion(const QJsonValue & result)
auto detail = item.value(MEMBER_DETAIL).toString();
auto doc = parseMarkupContent(item.value(MEMBER_DOCUMENTATION));
auto sortText = item.value(QStringLiteral("sortText")).toString();
if (sortText.isEmpty())
sortText = label;
auto insertText = item.value(QStringLiteral("insertText")).toString();
if (insertText.isEmpty())
insertText = label;
auto kind = (LSPCompletionItemKind) item.value(MEMBER_KIND).toInt();
ret.push_back({label, kind, detail, doc, sortText, insertText});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment