Author Topic: Feature Suggestion: Include-Walker  (Read 7237 times)

Offline The-Kenny

  • Multiple posting newcomer
  • *
  • Posts: 10
Feature Suggestion: Include-Walker
« 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.

Offline Steven 'lazalong'

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Feature Suggestion: Include-Walker
« Reply #1 on: April 09, 2008, 03:16:25 am »
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 - www.opengameengine.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Feature Suggestion: Include-Walker
« Reply #2 on: April 09, 2008, 08:28:36 am »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Feature Suggestion: Include-Walker
« Reply #3 on: April 09, 2008, 01:12:06 pm »
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Feature Suggestion: Include-Walker
« Reply #4 on: April 09, 2008, 01:40:17 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Feature Suggestion: Include-Walker
« Reply #5 on: April 09, 2008, 03:47:20 pm »
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).

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Feature Suggestion: Include-Walker
« Reply #6 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 :)


Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Feature Suggestion: Include-Walker
« Reply #7 on: April 10, 2008, 09:00:03 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 :(