From 5059b6de7181eda3377fde82fe0ed2f01476f7d0 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 12 Jun 2020 12:37:53 +0200 Subject: [PATCH] Language client: Rows in Go to Method are now similar to when Ctags is used to show methods --- src/source_language_protocol.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)