ListCell::ListCell( P_Object First_, P_Object Rest_ )
// - - - - - - - - - - - - - - - - - -
: First( First_ ) // <-- cursor HERE
, Rest( Rest_ )
// - - - - - - - - - - - - - - - - - -
{
// (do nothing)
}
Even though it's not related to version 9673 (it is MUCH older), I am going to report a bug in Code Completion since it seems to be the main improvement focus nowadays.First, thanks for the report, this is a feature request. Maybe, you can put it to BerliOS, but I suggest that the new Feature Request system will translated to Sourceforge, since BerliOS will be closed in one or two months. ;)
As far as I can remember, Code::Blocks has never provided autocompletion of a constructor's parameters within its initialization list. For instance, take this code:CodeListCell::ListCell( P_Object First_, P_Object Rest_ )
// - - - - - - - - - - - - - - - - - -
: First( First_ ) // <-- cursor HERE
, Rest( Rest_ )
// - - - - - - - - - - - - - - - - - -
{
// (do nothing)
}
When the cursor is inside the braces, CC correctly handles First_ and Rest_. But if the cursor is on the line with the arrow, I am offered completion for First (i.e. the class attribute), but not for First_.
PD: Searched for this, found nothing. Excuse me if it had already been said somewhere...
#define PTM_WARNING_DISABLE
#define PTM_WARNING_RESTORE
struct AFX_MSGMAP_ENTRY;
struct AFX_MSGMAP
{
const AFX_MSGMAP* (*pfnGetBaseMap)();
const AFX_MSGMAP_ENTRY* lpEntries;
};
#define BEGIN_MESSAGE_MAP(theClass, baseClass) \
PTM_WARNING_DISABLE \
const AFX_MSGMAP* theClass::GetMessageMap() const \
{ return GetThisMessageMap(); } \
const AFX_MSGMAP* theClass::GetThisMessageMap() \
{ \
typedef theClass ThisClass; \
typedef baseClass TheBaseClass; \
static const AFX_MSGMAP_ENTRY _messageEntries[] = \
{
#define END_MESSAGE_MAP() \
{0, 0, 0, 0, 0, 0 } \
}; \
static const AFX_MSGMAP messageMap = \
{ &TheBaseClass::GetThisMessageMap, &_messageEntries[0] }; \
return &messageMap; \
} \
PTM_WARNING_RESTORE
struct AFX_MSGMAP_ENTRY{
int a,b,c,d,e,f;
};
class BaseClass{
virtual AFX_MSGMAP* GetThisMessageMap();
public:
virtual AFX_MSGMAP* GetMessageMap();
};
class SomeClass : public BaseClass{
AFX_MSGMAP* GetThisMessageMap();
public:
AFX_MSGMAP* GetMessageMap();
};
/// known functions
void mynonmissingfunc1(){
}
void mynonmissingfunc2(){
}
BEGIN_MESSAGE_MAP(SomeClass, BaseClass)
// [...]
END_MESSAGE_MAP()/// somehow ignored
//} }/// uncomment this to detect all functions (in my real world example, I didn't need two "}" but one)
/// unknown functions
void mymissingfunc1(){
}
void mymissingfunc2(){
}
void mymissingfunc3(){
}
since there are some CC improvements.... I would like to see some bugs fixed as well ;)Hi, firstly, thanks for the minimal code. We have already said that CC's parsing don't expand macros on every Token. So
It happens from time to time that CC doesn't recognize specific functions, normally it's just 1-2 functions in a file... but using Microsoft MFC inside a project, almost completely kills CC.
As soon as a message map is used, CC is gone for everything below that.
Here's some test code (based on MFC code but slightly modified to minimize it)
...
BEGIN_MESSAGE_MAP(SomeClass, BaseClass)
// [...]
END_MESSAGE_MAP()
BEGIN_EVENT_TABLE -> -END_EVENT_TABLE
PS: I once had to declare "AFX_MSGMAP_ENTRY" without forward declaration... and it worked... dunno if that was real or not xDNot fully understand this sentence, can you show a minimal sample code? Thanks.
[...]are you sure about that? I've also tried to define my braces this way:CodeWhen it see BEGIN_MESSAGE_MAP, it don't expand it, same as END_MESSAGE_MAP().BEGIN_MESSAGE_MAP(SomeClass, BaseClass)
// [...]
END_MESSAGE_MAP()
[...]
[...]at least a work around in this case... thanks
The method you can do is to add one rule (manually replacement rule) in CC's setting dialog.CodeSo, those blocks were ignored. I think the document of such option should be updated in Code Completion Design - CodeBlocks (http://wiki.codeblocks.org/index.php?title=Code_Completion_Design#AAAAA_-.3E_-BBBBB), currently it is wrong.BEGIN_EVENT_TABLE -> -END_EVENT_TABLE
Also, if CC did try to expand every token, then it should work. See Huki's comments here: Re: X Macro (http://forums.codeblocks.org/index.php/topic,19024.msg130202.html#msg130202). Your problem is much like the X Macro problem.well... "Parse complex macros (needs more time)" is enabled :P Guess otherwise BEGIN_EVENT_TABLE wouldn't even be expanded... but END_EVENT_TABLE doesn't work and that is a bug.
[...]
Trying to download build 9673 but the links doesn't seem to work.. any other way??Do binaries from SourceForge (http://sourceforge.net/projects/codeblocks.berlios/files/) work for you?