Author Topic: Suggestion for TODO list plugin  (Read 8040 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Suggestion for TODO list plugin
« on: February 19, 2009, 12:32:08 am »
Hi. I wanted to suggest an addition for the TODO list plugin.

Currently the following strings are searched: //TODO //FIXME and //NOTE (well I don't know if they're searched for comments etc.

I'd also like to apply that search for #warning directives. When I compile my projects I'm using those warnings for TODOs, so I won't forget about them when I compile. The problem is that to search them I have to use search in files. Why not add #warning TODO etc. to the TODO list?

Just a suggestion. Thanks!

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Suggestion for TODO list plugin
« Reply #1 on: February 19, 2009, 03:16:07 am »
I'd also like to apply that search for #warning directives.

Looking at the TODO plugin code, I think Mandrav intended to support exactly that.

Mandrav, can I take a stab at implementing it?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Suggestion for TODO list plugin
« Reply #2 on: February 19, 2009, 11:28:42 am »
Why not add #warning TODO etc. to the TODO list?
Hey Rick, since a few revisions already you can setup *any* keywords yourself! Just hit "Add todo item" and in the following dialog add the keywords yourself as you like...
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Suggestion for TODO list plugin
« Reply #3 on: February 19, 2009, 12:05:26 pm »
Why not add #warning TODO etc. to the TODO list?
Hey Rick, since a few revisions already you can setup *any* keywords yourself! Just hit "Add todo item" and in the following dialog add the keywords yourself as you like...

Compiler warning and compiler error are already there, but they don't work.

If I chose compiler warning and type TODO I get something like:
Code
#warning TODO (jens#1#): test

All TODO's that come later in source code are not longer showed, neither is mine.
If I manually add comment-slashes before TODO it works:
Code
#warning // TODO (jens#1#): test

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Suggestion for TODO list plugin
« Reply #4 on: February 19, 2009, 01:55:46 pm »
Code
#warning // TODO (jens#1#): test
A simple modification should ensure this happens always (it seems to be a good solution). Any objections?

BTW: Those compiler #warning macros are not very nice anyways IMHO... I mean: They are fine for error checking like if all defines are set, platform is correct or alike. But not as a note / todo alike item. This is another philosophy I think. I mean: I use #warning for warnings to 3rd party devs that use e.g. my libraries and probably don't know how to handle them corrrectly. But ToDos / Notes are for myself and/or a dev team. At least that's how I always interpreted the functionality the ToDo plugin provides.
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Suggestion for TODO list plugin
« Reply #5 on: February 19, 2009, 02:05:54 pm »
No objections from me.

I don't use warnings or errors as todo's either, but I just tested it and stumbled over this issue.

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Suggestion for TODO list plugin
« Reply #6 on: February 19, 2009, 02:16:59 pm »
A simple modification should ensure this happens always (it seems to be a good solution). Any objections?

Since you're digging into that parsing code, here are some other wonky test cases you might be able to clear up.

This registers incorrectly as 2 entries:
Code
    char *x = "// TODO";
    // TODO: Fix
This registers incorrectly as 0 entries:
Code
    char *x = "TODO";
    // TODO: Fix
This registers incorrectly as 0 entries:
Code
    char *x = "NOTE";
    // NOTE: Fix
Although, oddly, this correctly gives the one TODO entry.
Code
    char *x = "NOTE";
    // TODO: Fix