@Alpha and all.
The steps to reproduce the bug:
1, set the symbol browser view option to show "current file's tokens"
2, open Codeblocks.cbp, let the parser finish its job
3, Open a header file, such as: plugins\codecompletion\classbrowserbuilderthread.h
4, edit the header file, and save it
5, see the updated symbol browser tree, you can see duplicated class labels.
Reason:
Rev9537 add inherit information for the class, saved in m_Args, but once a file get reparsed, it first try to delete the class definition token, since the class token shared between h/cpp, this does not actually remove the token, just adjust the m_File and m_Line info. Later when parsing the header,
the class token should be reused. After the rev9537, the bold line is not true any more.
// none of the above; check for token under parent
if (!newToken)
{
newToken = TokenExists(newname, baseArgs, m_LastParent, kind);
if (newToken)
{
TRACE(_T("DoAddToken() : Found token (parent)."));
// Special handling function implementation, see comments above
if (isImpl && (kind & tkAnyFunction))
newToken->m_Args = args;
}
}
This will create a new Token, not re-use the old one.
Another
bug I see is that void TokenTree::RemoveFile(int fileIdx) called
twice when a file is reparsed. One in GUI handler, one in thread pool's task (canparse = m_TokenTree->ReserveFileForParsing(filename, true) != 0;)
No time to dig further......