News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Suggestion for TODO list plugin

Started by rickg22, February 19, 2009, 12:32:08 AM

Previous topic - Next topic

rickg22

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!

DrewBoo

Quote from: rickg22 on February 19, 2009, 12:32:08 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?

MortenMacFly

Quote from: rickg22 on February 19, 2009, 12:32:08 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: [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]

Jenna

Quote from: MortenMacFly on February 19, 2009, 11:28:42 AM
Quote from: rickg22 on February 19, 2009, 12:32:08 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 warning and compiler error are already there, but they don't work.

If I chose compiler warning and type TODO I get something like:
#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:
#warning // TODO (jens#1#): test

MortenMacFly

Quote from: jens on February 19, 2009, 12:05:26 PM
#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: [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]

Jenna

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.

DrewBoo

Quote from: MortenMacFly on February 19, 2009, 01:55:46 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:

    char *x = "// TODO";
    // TODO: Fix

This registers incorrectly as 0 entries:

    char *x = "TODO";
    // TODO: Fix

This registers incorrectly as 0 entries:

    char *x = "NOTE";
    // NOTE: Fix

Although, oddly, this correctly gives the one TODO entry.

    char *x = "NOTE";
    // TODO: Fix