diff --git a/src/source_language_protocol.cpp b/src/source_language_protocol.cpp index e0b4df0..28c316f 100644 --- a/src/source_language_protocol.cpp +++ b/src/source_language_protocol.cpp @@ -41,7 +41,7 @@ LanguageProtocol::Location::Location(const boost::property_tree::ptree &pt, std: LanguageProtocol::Diagnostic::RelatedInformation::RelatedInformation(const boost::property_tree::ptree &pt) : message(pt.get("message")), location(pt.get_child("location")) {} -LanguageProtocol::Diagnostic::Diagnostic(const boost::property_tree::ptree &pt) : message(pt.get("message")), range(pt.get_child("range")), severity(pt.get("severity", 0)) { +LanguageProtocol::Diagnostic::Diagnostic(const boost::property_tree::ptree &pt) : message(pt.get("message")), range(pt.get_child("range")), severity(pt.get("severity", 0)), code(pt.get("code", "")) { auto related_information_it = pt.get_child("relatedInformation", boost::property_tree::ptree()); for(auto it = related_information_it.begin(); it != related_information_it.end(); ++it) related_informations.emplace_back(it->second); @@ -1008,7 +1008,12 @@ void Source::LanguageProtocolView::update_diagnostics_async(std::vectorbegin(); diff --git a/src/source_language_protocol.hpp b/src/source_language_protocol.hpp index ba26ca9..cfd5b28 100644 --- a/src/source_language_protocol.hpp +++ b/src/source_language_protocol.hpp @@ -69,7 +69,9 @@ namespace LanguageProtocol { Diagnostic(const boost::property_tree::ptree &pt); std::string message; Range range; + /// 1: error, 2: warning, 3: information, 4: hint int severity; + std::string code; std::vector related_informations; std::map> quickfixes; };