diff --git a/uppsrc/ide/Assist.cpp b/uppsrc/ide/Assist.cpp index 4aaf092c8..16cd071d4 100644 --- a/uppsrc/ide/Assist.cpp +++ b/uppsrc/ide/Assist.cpp @@ -127,17 +127,23 @@ bool isincludefnchar(int c) c != ' ' && c != '\"' && c != '/' && c != '\\' && c >= 32 && c < 65536; } -String AssistEditor::ReadIdBack(int q, bool include) +String AssistEditor::ReadIdBackPos(int& pos, bool include) { String id; bool (*test)(int c) = include ? isincludefnchar : iscid; - while(q > 0 && (*test)(GetChar(q - 1))) - q--; + while(pos > 0 && (*test)(GetChar(pos - 1))) + pos--; + int q = pos; while(q < GetLength() && (*test)(GetChar(q))) id << (char)GetChar(q++); return id; } +String AssistEditor::ReadIdBack(int q, bool include) +{ + return ReadIdBackPos(q, include ); +} + void AssistEditor::DirtyFrom(int line) { if(line >= cachedln) { diff --git a/uppsrc/ide/Debug.cpp b/uppsrc/ide/Debug.cpp index 3eb15ce62..d35c457f2 100644 --- a/uppsrc/ide/Debug.cpp +++ b/uppsrc/ide/Debug.cpp @@ -323,5 +323,33 @@ void Ide::OpenLog() bool Ide::EditorTip(CodeEditor::MouseTip& mt) { - return debugger && debugger->Tip(editor.ReadIdBack(mt.pos), mt); + if(!debugger) + return false; + int pos = mt.pos; + String e; + String sep; + while(pos >= 0) { + String b = editor.ReadIdBackPos(pos, false); + if(b.GetCount() == 0) + break; + e = b + sep + e; + sep = "."; + while(pos > 0 && editor.GetChar(pos - 1) == ' ') + pos++; + if(pos > 0 && editor.GetChar(pos - 1) == '.') + --pos; + else + if(pos >= 2 && editor.GetChar(pos - 1) == ':' && editor.GetChar(pos - 2) == ':') { + pos -= 2; + sep = "::"; + } + else + if(pos >= 2 && editor.GetChar(pos - 1) == '>' && editor.GetChar(pos - 2) == '-') + pos -= 2; + else + break; + while(pos > 0 && editor.GetChar(pos - 1) == ' ') + pos++; + } + return debugger->Tip(e, mt); } diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index e8d048566..d52dbdc19 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -424,6 +424,7 @@ struct AssistEditor : CodeEditor { void CloseAssist(); void Assist(); bool IncludeAssist(); + String ReadIdBackPos(int& pos, bool include); String ReadIdBack(int q, bool include = false); void SyncAssist(); void AssistInsert();