Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit e9d3a73

Browse files
committed
Language protocol: now reads the full hover result
1 parent 3647273 commit e9d3a73

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/source_language_protocol.cc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -917,11 +917,16 @@ void Source::LanguageProtocolView::show_type_tooltips(const Gdk::Rectangle &rect
917917
if(!error) {
918918
// hover result structure vary significantly from the different language servers
919919
std::string content;
920-
{
921-
auto contents_pt=result.get_child("contents", boost::property_tree::ptree());
922-
auto contents_it=contents_pt.begin();
923-
if(contents_it!=contents_pt.end())
924-
content=contents_it->second.get<std::string>("value", "");
920+
auto contents_pt=result.get_child("contents", boost::property_tree::ptree());
921+
for(auto it=contents_pt.begin();it!=contents_pt.end();++it) {
922+
auto value=it->second.get<std::string>("value", "");
923+
if(!value.empty())
924+
content.insert(0, value+(content.empty()?"":"\n\n"));
925+
else {
926+
value=it->second.get_value<std::string>("");
927+
if(!value.empty())
928+
content+=(content.empty()?"":"\n\n")+value;
929+
}
925930
}
926931
if(content.empty()) {
927932
auto contents_it=result.find("contents");

0 commit comments

Comments
 (0)