From 1babe51b5ea184f106bca6ecfc7b702d77237333 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Fri, 17 Apr 2026 11:26:24 +0200 Subject: [PATCH] ide: When inserting new code item to T++, qualification are removed (e.g. Upp::String -> String) --- uppsrc/ide/Browser/CodeRef.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/uppsrc/ide/Browser/CodeRef.cpp b/uppsrc/ide/Browser/CodeRef.cpp index c27326784..6eff1c400 100644 --- a/uppsrc/ide/Browser/CodeRef.cpp +++ b/uppsrc/ide/Browser/CodeRef.cpp @@ -208,6 +208,27 @@ String DecoratedItem(const String& name, const String& pretty) return qtf + "]"; } +String RemoveQualifications(const char *s) +{ + String r; + const char *s0 = s; + while(*s) { + if(iscib(*s)) { + r.Cat(s0, s); + s0 = s; + while(iscid(*s) || *s == ':') { + if(*s == ':') + s0 = s + 1; + s++; + } + } + else + s++; + } + r.Cat(s0, s); + return r; +} + String CreateQtf(const AnnotationItem& m, const String& lang, bool onlyhdr = false) { String qtf; @@ -216,7 +237,8 @@ String CreateQtf(const AnnotationItem& m, const String& lang, bool onlyhdr = fal qtf << "[s4 &]"; String st = str ? "[s2;" : "[s1;"; String k = st + ":" + DeQtf(m.id) + ": "; - String pretty = m.pretty; + String pretty = RemoveQualifications(m.pretty); + if(IsStruct(m.kind)) { pretty = m.pretty0; // because otherwise it is just a name int q = pretty.ReverseFind("{");