ide: When inserting new code item to T++, qualification are removed (e.g. Upp::String -> String)

This commit is contained in:
Mirek Fidler 2026-04-17 11:26:24 +02:00
parent 162be7b332
commit 1babe51b5e

View file

@ -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("{");