[hover] Change the first MarkedString's language to "text"

This commit is contained in:
Fangrui Song 2017-12-25 21:48:28 -08:00
parent 5a22a5cc66
commit 3df71f4145

View File

@ -3,7 +3,7 @@
namespace { namespace {
std::pair<optional<std::string>, std::string> GetHoverForSymbol( std::pair<optional<std::string>, std::string> GetCommentsAndHover(
QueryDatabase* db, QueryDatabase* db,
const SymbolIdx& symbol) { const SymbolIdx& symbol) {
switch (symbol.kind) { switch (symbol.kind) {
@ -94,12 +94,12 @@ struct TextDocumentHoverHandler : BaseMessageHandler<Ipc_TextDocumentHover> {
continue; continue;
std::pair<optional<std::string>, std::string> comments_hover = std::pair<optional<std::string>, std::string> comments_hover =
GetHoverForSymbol(db, ref.idx); GetCommentsAndHover(db, ref.idx);
if (comments_hover.first || comments_hover.second.size()) { if (comments_hover.first || comments_hover.second.size()) {
out.result = Out_TextDocumentHover::Result(); out.result = Out_TextDocumentHover::Result();
if (comments_hover.first) { if (comments_hover.first) {
out.result->contents.emplace_back( out.result->contents.emplace_back(
lsMarkedString{file->def->language, *comments_hover.first}); lsMarkedString{"text", *comments_hover.first});
} }
if (comments_hover.second.size()) { if (comments_hover.second.size()) {
out.result->contents.emplace_back( out.result->contents.emplace_back(