mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ide: PDB improved tips
git-svn-id: svn://ultimatepp.org/upp/trunk@7612 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c1070d4377
commit
915bb7a6ed
3 changed files with 39 additions and 4 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue