How do I handle TODO comments in VisualStudio 2010

2019-06-19 00:51发布

I'd like Visual Studio to list all lines having "TODO: " in their beginning (usually after a comment sign which may vary depending on the file type), that can be found in any textual file in a solution (whether it be C#, VB, F#, T-SQL, ASPX, XAML or just TXT) in a special panel showing what's written in the line to the right of "TODO: ", project name (I use many projects in one solution), file name, line number, and code block name (like class and method) if possible.

Do you know of such an extension, or maybe VisualStudio has this feature built-in somewhere? For example, NetBeans sort of has this out-of-the-box.

3条回答
成全新的幸福
2楼-- · 2019-06-19 01:04

similar here with exemple of how comments must be tagged: http://jack-fx.com/net/2010/01/23/todo-comments-in-visual-studio/

查看更多
贼婆χ
3楼-- · 2019-06-19 01:04
Evening l夕情丶
4楼-- · 2019-06-19 01:07

Here's how I'm using TODOs in VS as a poor man's issue tracker. Assumes that all my solutions are stored under some folder, let's call it "My Projects".

  1. Open "Find and Replace". Give a code name to "My Projects".
  2. In "Find", add //TODO (or //BUG, or other custom tag)
  3. In "Look In", specify the code name created in #1
  4. In "File types", leave only *.cs files (or wherever you store comments)
  5. Finally, in List results select "Find results 2 window" (in VS Pro or higher, n/a in VS Express)

Simply put, it does a full text search and displays lines with TODOs in a "Find Results 2" window. All you have to do is copy the list and open in your favorite text editor.

查看更多
登录 后发表回答