User forums > Nightly builds

The 06 March 2011 build (7040) is out.

<< < (3/8) > >>

ollydbg:

--- Quote from: eternallite on March 30, 2011, 09:01:00 am ---Hello! This is not really a big problem but I noticed that the new call tip doesn't bold the current argument you are on
while typing; for example, in SVN 6992, if a function f(int arg0, int arg1, int arg2) exists,
typing f(1, 2

while staying on 2, arg1 will appear bolded which is quite nifty but the new calltip doesn't seem
to be doing that :\

Anyway, wonderful job nonetheless :)

--- End quote ---
I can confirm this on my self build rev 7071 (Windows,wx2.8.11), I will take sometime to check it.  :D

ollydbg:

--- Quote from: ollydbg on March 30, 2011, 09:17:26 am ---
--- Quote from: eternallite on March 30, 2011, 09:01:00 am ---Hello! This is not really a big problem but I noticed that the new call tip doesn't bold the current argument you are on
while typing; for example, in SVN 6992, if a function f(int arg0, int arg1, int arg2) exists,
typing f(1, 2

while staying on 2, arg1 will appear bolded which is quite nifty but the new calltip doesn't seem
to be doing that :\

Anyway, wonderful job nonetheless :)

--- End quote ---
I can confirm this on my self build rev 7071 (Windows,wx2.8.11), I will take sometime to check it.  :D

--- End quote ---

it seems the code: codecompletion.cpp line around 1446

--- Code: ---    int start = 0;
    int end = 0;
    int count = 0;
    int commas = m_NativeParser.GetCallTipCommas(); // how many commas has the user typed so far?
    wxArrayString items = m_NativeParser.GetCallTips(maxCalltipLineSizeInChars);
    std::set< wxString, std::less<wxString> > unique_tips; // check against this before inserting a new tip in the list
    wxString definition;
    for (unsigned int i = 0; i < items.GetCount(); ++i)
    {
        // allow only unique, non-empty items with equal or more commas than what the user has already typed
        if (unique_tips.find(items[i]) == unique_tips.end() && // unique
            !items[i].IsEmpty() && // non-empty
            commas <= m_NativeParser.CountCommas(items[i], 1)) // commas satisfied
        {
            unique_tips.insert(items[i]);
            if (count != 0)
                definition << _T('\n'); // add new-line, except for the first line
            definition << items[i];
            m_NativeParser.GetCallTipHighlight(items[i], &start, &end);
            ++count;
        }
    }
    if (!definition.IsEmpty())
        ed->GetControl()->CallTipShow(pos, definition);
//    Manager::Get()->GetLogManager()->DebugLog(_T("start=%d, end=%d"), start, end);
    // only highlight current argument if only one calltip (scintilla doesn't support multiple highlighting ranges in calltips)
    ed->GetControl()->CallTipSetHighlight(count == 1 ? start : 0, count == 1 ? end : 0);
}

--- End code ---
the text between "start" and "end" will be highlight, but these interval was always wrong.  :(

ollydbg:
ok, debug a little, and I have found that the reason is:

recently, we use some pretty printer mechanism to do the call tip,
My test code is:

--- Code: ---void f11111(int arg0, int arg1, int arg2);

f11111(1111111,)

--- End code ---
I just enter a commas in the last line.


so the code works wrong


--- Code: ---
int commas = m_NativeParser.GetCallTipCommas(); // how many commas has the user typed so far?
    wxArrayString items = m_NativeParser.GetCallTips(maxCalltipLineSizeInChars);
    std::set< wxString, std::less<wxString> > unique_tips; // check against this before inserting a new tip in the list
    wxString definition;
    for (unsigned int i = 0; i < items.GetCount(); ++i)
    {
        // allow only unique, non-empty items with equal or more commas than what the user has already typed
        if (unique_tips.find(items[i]) == unique_tips.end() && // unique
            !items[i].IsEmpty() && // non-empty
            commas <= m_NativeParser.CountCommas(items[i], 1)) // commas satisfied
        {
            unique_tips.insert(items[i]);
            if (count != 0)
                definition << _T('\n'); // add new-line, except for the first line
            definition << items[i];
            m_NativeParser.GetCallTipHighlight(items[i], &start, &end);
            ++count;
        }
    }

--- End code ---
Here, items[0]="void f11111(int arg0, int arg1, int arg2)"
and commas calculated by "m_NativeParser.GetCallTipCommas();" is 1

But see the statement:

--- Code: ---commas <= m_NativeParser.CountCommas(items[i], 1)) // commas satisfied

--- End code ---

This will get false, because we pass a full string "void f11111(int arg0, int arg1, int arg2)", and CountCommas return ZERO. so we have No way to calculate the "start" and "end".

Maybe, the idea is: pass only the argument string which is "int arg0, int arg1, int arg2" to CountCommas() function, so the commas position should be satisfied.

Any ideas??? :D

Cubic:
I don't know if this is related, but the call tip apparently appears only after the first comma is entered, and disappears for good if the first comma is deleted.
ex:
--- Code: ---void uninitGL(HWND hWnd);
--- End code ---
No tip:
--- Code: ---uninitGL(hWnd);
--- End code ---
Tip:
--- Code: ---uninitGL(,hWnd);
--- End code ---
Tip disappears again and doesn't reappear:

--- Code: ---uninitGL();
--- End code ---

oBFusCATed:
It is not related (probably), but it is very annoying behavior, it is great that you've been able to reproduce it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version