From e9d3a731a144b19124c4ecec17ced7a1fc617143 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 11 Feb 2018 11:08:53 +0100 Subject: [PATCH] Language protocol: now reads the full hover result --- src/source_language_protocol.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/source_language_protocol.cc b/src/source_language_protocol.cc index 7c5438f..660026a 100644 --- a/src/source_language_protocol.cc +++ b/src/source_language_protocol.cc @@ -917,11 +917,16 @@ void Source::LanguageProtocolView::show_type_tooltips(const Gdk::Rectangle &rect if(!error) { // hover result structure vary significantly from the different language servers std::string content; - { - auto contents_pt=result.get_child("contents", boost::property_tree::ptree()); - auto contents_it=contents_pt.begin(); - if(contents_it!=contents_pt.end()) - content=contents_it->second.get("value", ""); + auto contents_pt=result.get_child("contents", boost::property_tree::ptree()); + for(auto it=contents_pt.begin();it!=contents_pt.end();++it) { + auto value=it->second.get("value", ""); + if(!value.empty()) + content.insert(0, value+(content.empty()?"":"\n\n")); + else { + value=it->second.get_value(""); + if(!value.empty()) + content+=(content.empty()?"":"\n\n")+value; + } } if(content.empty()) { auto contents_it=result.find("contents");