Code::Blocks Forums

User forums => Help => Topic started by: joubertdj on September 22, 2006, 11:48:20 am

Title: Where is the other procedures/functions in Code Completion?
Post by: joubertdj on September 22, 2006, 11:48:20 am
Hi C::B

I have been watching the C::B development closely...
The "older" CodeCompletion used to have a type of cache where you would iterate through all of your include files to get all the functions and variables and so on and so forth... worked nicely... but you ended up with only using a small part of it...
The "newer" (In development one) works far better in the sense of effeciency... Am I correct so far?

The query that I have is this... When I use my Allegro header file... I only seem to have the functions that is within the specific #include<allegro.h> file... I am missing some other functions and or procedures that is used by allegro.h... do I need to add everyone with the function that I require... or does the new code completion go through the allegro.h's include files to determine all the functions and procedures in your project?

I am missing some functions you see, which I know out of my head... but it would be nice if it be in the code completion...

Title: Re: Where is the other procedures/functions in Code Completion?
Post by: mandrav on September 22, 2006, 12:47:17 pm
The parser "follows" #includes as it sees them. Two factors can affect this:



Finally, code inside #if-#ifdef-#ifndef-#elif-#else-#endif preprocessor macros is parsed differently now than before. The old behaviour was to parse everything. This would be ok some times but some other times it would produce wrong results (and faulty code-completion).
The new approach is the same as ctags (AFAIK): the #elif-#else-#endif parts are ignored. Except the special case #if 0 where it should ignore this and parse the #else part (but it doesn't: it's on the todo list).
Title: Re: Where is the other procedures/functions in Code Completion?
Post by: joubertdj on September 22, 2006, 12:55:18 pm
Thanks for the quick reply... I will go and play with the settings to see if I can't achieve my desired results.
Title: Re: Where is the other procedures/functions in Code Completion?
Post by: joubertdj on September 22, 2006, 01:34:57 pm
 :x Okay ... so I enabled everything in local and global in the code completion configuration. I also added the include directories... both (c:\mingw\include and c:\mingw\include\allegro) in the targets,global, and local area... even though the compiler sees everything... stil nothing more than what I had...

Then I noticed something... and it is probably another white rabbit... but in the allegro.h files... all it's include files are declared as #include "something"
so I changed that to #include <something>

that still did not do it... the irony is... I think it is only the allegro files... because my own files and projects has everything sorted and working sweet... Ah well...

Any final ideas before I just accept and continue?
Title: Re: Where is the other procedures/functions in Code Completion?
Post by: joubertdj on September 22, 2006, 01:52:42 pm
I determined through all the #ifndef ALLEGRO_H type declerations that all of the files are "seen" and "run" through... and then I saw how they declared the functions... ouch... don't know if your code parser will sort out that type of function decleration:

They use this helper function:

#ifndef AL_FUNC
   #define AL_FUNC(type, name, args)               type name args
#endif

and then they declare the function in another header with:

AL_FUNC(void, get_executable_name, (char *output, int size));

 :shock: Me to basic to go through everything... but me understand now why it not work...
Title: Re: Where is the other procedures/functions in Code Completion?
Post by: mandrav on September 22, 2006, 02:13:24 pm
No, sorry. Our parser doesn't handle this and never will. It's parsing at least half-sane code. This is insane :)...