News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Feature Suggestion: Include-Walker

Started by The-Kenny, April 08, 2008, 07:37:20 PM

Previous topic - Next topic

The-Kenny

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.

Steven 'lazalong'

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
-------------------------------
OGE - [url="//www.opengameengine.org"]www.opengameengine.org[/url]

MortenMacFly

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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Biplab

Quote from: MortenMacFly on April 09, 2008, 08:28:36 AM
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. :)
Be a part of the solution, not a part of the problem.

MortenMacFly

Quote from: Biplab on April 09, 2008, 01:12:06 PM
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Ceniza

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).

joubertdj

Quote(at least it has passed all my evil tests)

Ceniza, if it can do Allegro's API ... then it passes my "holy grail" test :)


Ceniza

Quote from: joubertdj on April 10, 2008, 03:41:04 PM
Quote(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 :(