Search
Tuesday, November 20, 2018 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Blogroll  
     
  
   Disclosure  
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
     
  
   TechTidBits (Blog)  

How do you ///todo?

Sep 11

Written by:
Thursday, September 11, 2008 8:44 PM  RssIcon

From yesterday's blog, I hope you noticed I'm a fan of the ///todo tag!  I raised one caveat, you cannot see all your solution's or project's ///todo tags for unopened files.  So how can you fix this you ask?  Great question!  It's actually quite simple, but you'll need to get your hands dirty with a bit of code.  We're all code-heads here right?  So this shouldn't be too foreign?!  Let's dive in!

If you're reading this now, you're a fan of VS' ///todo tags and want to find out how to see ALL the ///todo tags in your solution/project, even no files are open.

I learned this trick from ShaharY on a blog on Dev102 (they have some great tips'n'tricks over there, check'em out!).  What they do is add a command to the Tools|External Tools menu option where you can easily "Show All Todo Tasks."  Then once you select that menu option, your code is interrogated for all the "///todo" tags and listed there.  Then you can double click them to jump to the right place in code to edit them!  Beautiful!

But I'm letting my excitement get a head of me, let's install and configure this to work for you on your computer.

First, download the source zip file.  Open up the solution in VS and then compile it.  Make sure you know where the exe is created cause you're going to need it next.  Goto Tools|External Tools menu option and enter the following data.

External Tools Setup

Ensure you have the proper directory location and exe for the Command parameter. The parameters for the Arguments and Initial directory are the magic pieces here to make this work properly.  Also make sure the Use Output window is checked.

Once that is done, the tool is installed and configured (see, not so hard?! :>).  Next we're going to try it out.  Open up the solution you created to test out the ///todo from yesterday's blog.  Didn't great one, no probs, just whip one up now, or open up another solution and put a few ///todos in there now.  Once you've done that, goto Tools|Show All Todo Tasks.

Show All Todo Tasks menu option in action

 After you click that option, VS will start chugging away (don't worry, it's only sniffing out the ///todo tags in your code).  Once it's done, you'll see the Output window.

Output Window Results

 Next you can double click any of the lines and BINGO, you're on that line of code.  Looking for an improvement?  Try placing an ampersand in front of the letter in the External Tools dialog so you can use the Alt keys to get faster access to the menu option.

Notes:  I've made some small tweaks to the code from the source code on Dev102 to make it work better for me.  If you find more improvements, please drop me a line and let me know what you found worked for you! :>  I've love to read about it!

Resources

Tags:
Categories:
Location: Blogs Parent Separator TechTidBits

8 comment(s) so far...


Writing Offer

Hi Peter

I don't see any contact page so I am using a comment.
I am from Dev102. We saw your comment and post, first of all thanks for reading. We were wandering whether you would like to guest post at Dev102

if you are interested mail me back at admin@dev102.com and we can discuss further details.

Thanks

Amit
Dev102.com

By Amit on   Friday, September 12, 2008 8:46 AM

Re: How do you ///todo?

Thanks for this great work :-)!

Please modify your code to work with C#, C and C++:

foreach (string file in Directory.GetFiles(path, "*.c*")) // includes *.cs, *.c, *.cpp --> works with C#, C and C++
{
m_Files.Add(file);
//AnalyseFile(file);
}

foreach (string file in Directory.GetFiles(path, "*.h*")) // includes *.h, *.hpp --> expands C, C++ functionaly
{
m_Files.Add(file);
//AnalyseFile(file);
}

Best regards!
Rene

By Rene on   Monday, February 23, 2009 4:56 PM

Re: How do you ///todo?

Thanks for this great work :-)!

Please modify your code to work with C#, C and C++:

foreach (string file in Directory.GetFiles(path, "*.c*")) // includes *.cs, *.c, *.cpp --> works with C#, C and C++
{
m_Files.Add(file);
//AnalyseFile(file);
}

foreach (string file in Directory.GetFiles(path, "*.h*")) // includes *.h, *.hpp --> expands C, C++ functionaly
{
m_Files.Add(file);
//AnalyseFile(file);
}

Best regards!
Rene

By Rene on   Monday, February 23, 2009 4:56 PM

Re: How do you ///todo?

Thanks Rene, I liked your idea so much, I did another post, put the code on SVN and am replying again! hhhhmmmmm I need to get back to my other work! :>

Here's the link, http://www.pchenry.com/Default.aspx?TabId=36&EntryID=28. Have a good night! :>

Grab a coffee and get coding! :>

By phenry on   Monday, February 23, 2009 9:44 PM

Re: How do you ///todo?

Hey Peter,

your tool (after modifying für c++) is one of my most used external tools today, i like it!!!
and - oh shit - my first contact with C# :-D

thanks and good night!
Rene

By Rene on   Tuesday, February 24, 2009 5:07 PM

Re: How do you ///todo?

Fantastic! Thanks for coming back and letting me know, that's what I love to read! :> Very cool Rene! :> I hope you return again to read some more (I could use another reader :> haha LOL! :>).

If you see any updates, please let me know (or continue since you've already done that! :>). Thanks again and have a good one! :>

re für
Do you mind me asking if you're visiting from Germany? Very cool! Take care and have a good day! :>

By phenry on   Tuesday, February 24, 2009 9:12 PM

Re: How do you ///todo?

Hi Peter,
You really rock with this solution !! Hats off to you ...Thanks

By Phool Singh on   Monday, April 13, 2009 8:32 AM

Re: How do you ///todo?

Thank you Phool, but the real credit goes to the guys over at Dev 102, they created the first version and I just tweaked it a bit. Thank you for leaving a comment and I'm really glad you enjoy it! :> Very cool! :>

By phenry on   Monday, April 13, 2009 8:34 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
     
  
Copyright 1999-2012 by PCHenry.com   Terms Of Use  Privacy Statement