Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Doxygen and MSVC TODO tags to work together

In doxygen, the standard "/// \todo stuff" is used to tag a todo item. I do most of my coding in MSVC so it's handy to be able to see the TODO's in the Task List. MSVC uses "//TODO stuff" for their tags. Is there any way to make them work together? I found the properties pane for the Task list and try to add "\todo" to the list, but it doesn't like the "\" character. Can I make these two work together?

Edit: I am specifically interested to find out how to do this in Visual Studio 10.

like image 263
shadowland Avatar asked Sep 25 '09 20:09

shadowland


People also ask

How do you use Doxygen to generate documentation?

To use Doxygen, you simply comment your source code in a syntax that Doxygen can read. Doxygen then walks through your source files and creates HTML or LaTeX documentation based on those special comments.

What is a doxygen tag?

Doxytag is a small command line based utility. It can generate tag files. These tag files can be used with doxygen to generate references to external documentation (i.e. documentation not contained in the input files that are used by doxygen).

How do I show code in doxygen?

You can put example source code in a special path defined in the doxygen config under EXAMPLE_PATH , and then insert examples with the @example tag. Doxygen will then generate an extra page containing the source of the example. It will also set a link to it from the class documentation containing the example tag.


2 Answers

IIRC doxygen supports javadoc-style structural commands, i.e. you should be able to use @todo and \todo interchangeably, in the eventuality that MSVC will accept @todo as a task marker:

Structural commands (like all other commands) start with a backslash (), or an at-sign (@) if you prefer JavaDoc style, followed by a command name and one or more parameters.

Another option is to use FILE_VERSION_FILTER as a doxygen preprocessor, providing a custom script (or program), e.g. if you have Cygwin installed in C:\cygwin then the following will work nicely:

FILE_VERSION_FILTER = "C:\cygwin\bin\sed -e 's:// *TODO:@todo:g'"
like image 108
vladr Avatar answered Sep 22 '22 11:09

vladr


I don't know about the way VS treats these "TODO"s. But I think there is an easy way if it also recognizes \TODO as a to do item. In this case you might want to have a look at the doxygen documentation for \xref. This allows you to create tag/commands and link to a special section and a related page. \todo or @todo is defined as

\xrefitem todo "Todo" "Todo List"

What you can do now to create a custom "\TODO" or "@TODO" command is go to your configuration file or the doxywizard and add the line

\xrefitem TODO "Todo" "Todo List" 

to it. Maybe that helps.

like image 24
HaMster Avatar answered Sep 21 '22 11:09

HaMster