Code Completion missing some functions?

General questions regarding the usage of CodeLite
yes9111
CodeLite Curious
Posts: 5
Joined: Sun Mar 22, 2009 1:23 pm
Contact:

Code Completion missing some functions?

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion missing some functions?

Post 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
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion missing some functions?

Post 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
Make sure you have read the HOW TO POST thread
yes9111
CodeLite Curious
Posts: 5
Joined: Sun Mar 22, 2009 1:23 pm
Contact:

Re: Code Completion missing some functions?

Post by yes9111 »

That did it! Thank you so much.
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion missing some functions?

Post 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
Make sure you have read the HOW TO POST thread
yes9111
CodeLite Curious
Posts: 5
Joined: Sun Mar 22, 2009 1:23 pm
Contact:

Re: Code Completion missing some functions?

Post 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!
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion missing some functions?

Post 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
Make sure you have read the HOW TO POST thread
Post Reply