It looks like there are some item sort issue.
I see the CC gives the suggestion list as:
"
aaa(): int\n13\r
Bbb(): int\n13\r
Gethod6(): void\n13\r
Kethod1(): void\n13\r
Kethod2(): void\n13\r
Method3(): void\n13\r
method4(): void\n13\r
method5(): void\n13
"
Look, it is case insensitive, but I see in the function void AutoComplete::Select(const char *word), it use this
if (ignoreCase)
cond = CompareNCaseInsensitive(word, item, lenWord);
else
cond = strncmp(word, item, lenWord);
The strncmp is used, so it cause errors, in this case, CompareNCaseInsensitive should be used.
In CC, we have a sorter:
bool isPureAlphabetical = true;
TokenSorter sortFunctor(isPureAlphabetical);
std::sort(m_AutocompTokens.begin(), m_AutocompTokens.end(), sortFunctor);
But it looks like TokenSorter is always case insensitive.
// priority, then alphabetical
struct TokenSorter
{
bool& m_PureAlphabetical;
TokenSorter(bool& alphabetical) : m_PureAlphabetical(alphabetical)
{
m_PureAlphabetical = true;
}
bool operator()(const cbCodeCompletionPlugin::CCToken& a, const cbCodeCompletionPlugin::CCToken& b)
{
int diff = a.weight - b.weight;
if (diff == 0)
{
// cannot use CmpNoCase() because it compares lower case but Scintilla compares upper
diff = a.displayName.Upper().Cmp(b.displayName.Upper());
if (diff == 0)
diff = a.displayName.Cmp(b.displayName);
}
else
m_PureAlphabetical = false;
return diff < 0;
}
};
So, we should set "case insensitive" in our CC option, otherwise, this bug happens.