diff --git a/src/source_language_protocol.cpp b/src/source_language_protocol.cpp index c90a7a5..3e78bbe 100644 --- a/src/source_language_protocol.cpp +++ b/src/source_language_protocol.cpp @@ -866,14 +866,14 @@ void Source::LanguageProtocolView::setup_navigation_and_refactoring() { if(container == "null") container.clear(); if(!container.empty()) - prefix = container + "::"; + prefix = container; } else { range = std::make_unique(it->second.get_child("range")); if(!container.empty()) - prefix = container + "::"; + prefix = container; } - methods.emplace_back(Offset(range->start.line, range->start.character), std::to_string(range->start.line + 1) + ": " + Glib::Markup::escape_text(prefix) + "" + Glib::Markup::escape_text(it->second.get("name")) + ""); + methods.emplace_back(Offset(range->start.line, range->start.character), (!prefix.empty() ? Glib::Markup::escape_text(prefix) + ':' : "") + std::to_string(range->start.line + 1) + ": " + "" + Glib::Markup::escape_text(it->second.get("name")) + ""); } auto children = it->second.get_child_optional("children"); if(children)