diff --git a/uppsrc/CppBase/Qualify.cpp b/uppsrc/CppBase/Qualify.cpp index 4e0ee2172..1ace92118 100644 --- a/uppsrc/CppBase/Qualify.cpp +++ b/uppsrc/CppBase/Qualify.cpp @@ -29,13 +29,13 @@ bool Qualify0(ScopeInfo& nf, const String& type, const String& usings, String& q return true; } if(DoQualify(hnf, qs, usings, qn)) { - if(nf.base.Find(type) >= 0) { - qt = type; + String tp = type.Mid(q + 1); + if(nf.base.Find(qn) >= 0) { + qt = qn + "::" + tp; return true; } int scopei = nf.base.Find(qn); if(scopei >= 0) { - String tp = type.Mid(q + 1); ScopeInfo nnf(nf.base, scopei); const Vector& bs = nnf.GetBases(); for(int i = 0; i < bs.GetCount(); i++) { diff --git a/uppsrc/ide/ContextGoto.cpp b/uppsrc/ide/ContextGoto.cpp index 7958f2708..426f2293f 100644 --- a/uppsrc/ide/ContextGoto.cpp +++ b/uppsrc/ide/ContextGoto.cpp @@ -166,7 +166,7 @@ void Ide::ContextGoto0(int pos) while(iscid(editor.Ch(q - 1))) q--; String tp; - Vector xp = editor.ReadBack(q); // try to load expression lien "x[i]." or "ptr->" + Vector xp = editor.ReadBack(q); // try to load expression like "x[i]." or "ptr->" Index type; Parser parser; int ci = pos; @@ -181,7 +181,7 @@ void Ide::ContextGoto0(int pos) ci++; } editor.Context(parser, ci); - + DDUMP(xp); if(xp.GetCount()) { type = editor.EvaluateExpressionType(parser, xp); if(type.GetCount() == 0) @@ -235,9 +235,23 @@ void Ide::ContextGoto0(int pos) Vector ns = parser.GetNamespaces(); + DDUMP(qual); + DDUMP(id); if(qual.GetCount()) { // Ctrl::MOUSELEFT, Vector::Iterator Vector todo; - todo.Add(RemoveTemplateParams(Qualify(CodeBase(), parser.current_scope, qual + "::" + id, parser.context.namespace_using))); + String qa = Qualify(CodeBase(), parser.current_scope, qual + "::" + id, parser.context.namespace_using); + qa = RemoveTemplateParams(qa); + if(CodeBase().Find(qa) < 0) { // Upp::FileTabs::RenameFile + int q = qa.ReverseFind("::"); + if(q > 0) { + String h = qa.Mid(0, q); + if(CodeBase().Find(h) >= 0) { + scope.Add(h); + istype.Add(false); + } + } + } + todo.Add(qa); while(scope.GetCount() < 100 && todo.GetCount()) { String t = todo[0]; if(t.EndsWith("::"))