Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: The-Kenny on April 08, 2008, 07:37:20 pm
-
Hello,
I think I have an idea for a useful extension: A plugin/dialog/something which displays a tree with all includes of the current file/project.
So could any user see fast which files depends on another and which includes are doesn't needed.
This feature is possible easy to implent, because the parsing is already done in the $(project).depends-file.
-
nice idea.
And use for example a red icon as leaf when it detect a recursive include.
So instead of: file1.h -> file2.h -> file1.h -> file1.h -> etc
you get: file1.h -> file2.h -> file1.h
-
You can achieve this using thrid party tools such as Doygen if you like. But yes: Having that as a plugin would be nice and shouldn't be too hard to implement. Hence for the core devs I'm afraid other things are more important first.
Probably I can encourage plugin devs (or people that always had in minf to try tro write a plugin) to do so hereby. Honstly: It shouldn't be too hard.
-
Honstly: It shouldn't be too hard.
It may be difficult to implement. If you include headers inside #ifdef and with a complicated expression to evaluate, you will need a good parser to find out the dependency. :)
-
If you include headers inside #ifdef and with a complicated expression to evaluate, you will need a good parser to find out the dependency. :)
Well... C::B ships with depslib, right?! ;-)
But yes: You can make it complex for sure.
-
A good parser? You just need a good preprocessor. The code I have could be reworked a bit to implement that. It's already able to handle complex #if expressions, and it includes full macro replacing (at least it has passed all my evil tests).
I still need to insert hooks into it, so it can notify includes. I also need to allow the insertion of user defined macros (easy).
-
(at least it has passed all my evil tests)
Ceniza, if it can do Allegro's API ... then it passes my "holy grail" test :)
-
(at least it has passed all my evil tests)
Ceniza, if it can do Allegro's API ... then it passes my "holy grail" test :)
Now that you mention it, it'd be a nice test. I even remember I had to create my own header file with all the function declarations (I took them from the API reference file IIRC), so Dev-C++ would read them from it to be able to code-complete. Oh, the old days!
I'll try to keep it mind to test it when I continue working on it. It should work fine after adding just a few minor details to the current code. I hope it does. If it doesn't, then I'll have more bugs to eat... er... fix :(