Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
Find Declaration of constructor doesn't work
GeO:
As the title say, the declaration of wxWidgets constructors (maybe other external constructors too) cannot be found.
For example: if you have this single line and you click "find declaration" on the first wxStaticText* the class wxStaticText will correctly showed,
however if you click on the constructor wxStaticText, the message "Declaration not found" will popup.
--- Code: ---wxStaticText* static = new wxStaticText(this, wxID_ANY, label, pos, size, style, name);
--- End code ---
I'm using the latest package from jens (rev 6853).
ollydbg:
I have just test a simple code:
--- Code: ---#include <iostream>
using namespace std;
class AAA
{
public:
AAA(){};
int a;
};
int main()
{
AAA * p = new AAA();
cout << "Hello world!" << endl;
return 0;
}
--- End code ---
I can reproduce this bug.
I will check it.
ollydbg:
I think the bug was introduced in the rev
--- Quote ---loaden 2010-11-2 22:30:23
* special handle constructor function for 'Goto declaration' and 'Goto implementation'
--- End quote ---
I just debug the code to line 2672 of codecompletion.cpp, code snippet below:
--- Code: --- if (isClassOrConstructor)
{
const bool isConstructor = (GetNextNonWhitespaceChar(editor->GetControl(), end) == _T('('));
for (TokenIdxSet::iterator it = result.begin(); it != result.end();)
{
Token* tk = tokens->at(*it);
if (isConstructor && tk && tk->m_TokenKind == tkClass)
result.erase(it++); //line 2672 ---------------------------------------------------------------
else if (!isConstructor && tk && tk->m_TokenKind == tkConstructor)
result.erase(it++);
else
++it;
}
}
}
--- End code ---
the result contains only one token. but the line 2672, it seems the correct token was deleted. Any ideas??? Loaden or others.
ollydbg:
the result token set should have two tokens, they are:
1 class AAA
2 constructor AAA::AAA
but I get only one token, which is "class AAA". so, it seems there is a bug in other place. (not the line 2672 in my previous post).
Edit
it seems the constructor AAA::AAA is the child of class AAA, so it is correct that only one token(class AAA) as the result. So we should do special handling of this kind of "find declaration". :D
proxym:
Find Declaration of constructor still doesn't work. 2014 year now.
Instead of showing declaration of constructor it shows declaration of class.
Code::blocks svn 9455.
Navigation
[0] Message Index
[#] Next page
Go to full version