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:
void f11111(int arg0, int arg1, int arg2);
f11111(1111111,)
I just enter a commas in the last line.
so the code works wrong
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;
}
}
Here, items[0]="void f11111(int arg0, int arg1, int arg2)"
and commas calculated by "m_NativeParser.GetCallTipCommas();" is 1
But see the statement:
commas <= m_NativeParser.CountCommas(items[i], 1)) // commas satisfied
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???