Page 1 of 1

Code Completion missing some functions?

Posted: Sun Feb 14, 2010 6:43 am
by yes9111
First off, I want to say this is the best IDE I have used so far and want to thank the development team :D
Now for the minor annoyances..
I installed Codelite for windows that comes with MinGW and wxWidgets and I think the code completion feature is skipping over some include files or I'm not specifying them?
For example, the main.cpp that gets created when you do Create GUI app with wxWidgets enabled, the Connect() function doesn't seem to be in the tag database. Nor does wxEVT_COMMAND_BUTTON_CLICKED! Am I missing something in my Tag settings? I installed all packages in their default locations.
C:\wxWidgets-2.8.10\include
C:\MinGW-4.4.0\include
C:\MinGW-4.4.0\lib\gcc\mingw32\4.4.0\include\c++
Again, thanks for the excellent IDE as well as your time :D

Re: Code Completion missing some functions?

Posted: Sun Feb 14, 2010 12:26 pm
by eranif
You are not missing anything. Since wxWidgets does a massive use of macros in their code, it probably fooled the parser.

Connect() method does exist in the tags database but since it is inherited from wxEvtHandler class, my guess is that codelite probably failed to collect all parents (the common error: one of the class names is actually a macro... something like:

Code: Select all

#define wxWindow wxWindowMSW
I will look into this and see how can I improve the pre-processor handling

Eran

Re: Code Completion missing some functions?

Posted: Sun Feb 14, 2010 1:25 pm
by eranif
I looked at wxWidgets sources a bit, and to solve both of your problems, you should do this:

- Open the tag settings dialog (from the menu: Settings -> Tags Settings)
- Select the 'Advanced' tab
- Click on the button with the 3 dots ('Preprocessors')

Copy / Paste the below to your preprocessor list:

Code: Select all

wxWindowNative=wxWindowBase
BEGIN_DECLARE_EVENT_TYPES()=enum {
END_DECLARE_EVENT_TYPES()=};
DECLARE_EXPORTED_EVENT_TYPE
DECLARE_EVENT_TYPE
- Close the tags dialog
- Retag your workspace using the *full* option (from the menu: Workspace -> Retag Workspace ( full ))

You should now the completion for both wxEVT_COMMAND* and Connect() methods (and others)

Eran

Re: Code Completion missing some functions?

Posted: Sun Feb 14, 2010 10:21 pm
by yes9111
That did it! Thank you so much.

Re: Code Completion missing some functions?

Posted: Sun Feb 14, 2010 10:24 pm
by eranif
yes9111 wrote:That did it! Thank you so much.
I included that to be part of the next release so everyone will enjoy it :P

Eran

Re: Code Completion missing some functions?

Posted: Tue Feb 16, 2010 8:52 am
by yes9111
Just a quick add on question!
the wxMiniApp class that's created by default has the M (Member?) logo next to it in the outline and is placed under "Global Functions and Variables". Is this supposed to happen because all classes that I create come out with a green C at top level in the outline.

Me just being nitpicky =P

Thanks!

Re: Code Completion missing some functions?

Posted: Tue Feb 16, 2010 12:03 pm
by eranif
I am not sure what you are talking about here.. but:

Add this to the 'Tags Settings -> Advanced -> Preprocessors':

Code: Select all

IMPLEMENT_APP+
retag the workspace (full) and will be placed correctly.

Eran