Getting Doxygen and MSVC TODO tags to work together

我只是一个虾纸丫 提交于 2019-12-18 13:25:53

问题


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.


回答1:


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'"



回答2:


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.



来源:https://stackoverflow.com/questions/1479311/getting-doxygen-and-msvc-todo-tags-to-work-together

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!