.NET Zone is brought to you in partnership with:

Dr. David Shepherd has studied software tools at U of Delaware, developed tools at Tasktop Technologies, and is now doing some of both at ABB Corporate Research, where he has a chance to impact the thousands of developers that ABB employs. His articles are focused on helping developers increase their personal productivity by harnessing available software tools. David is a DZone MVB and is not an employee of DZone and has posted 11 posts at DZone. You can read more from them at their website. View Full User Profile

Search It Sando Style - C#, C, and C++ Code Search Plugin for VS 2010

10.17.2012
| 1418 views |
  • submit to reddit

 

Picture 

If you're going to search, please do it with style.

When fixing bugs most software developers start with a search.  I know.  I've watched them. They read the bug report, reproduce the problem (sometimes), and then search for relevant code. This is when it gets ugly.  Developers either wander semi-randomly around the Solution Explorer (Roomba Style), struggle to use Find in Files with increasing levels of anger (William Foster Style), or I've even seen one user step through almost the entire program in the debugger (Slowskys Style). Please, for goodness' sake, next time you search try Sando Style.  Our newly released version of Sando (0.3), is a free, open source extension for VS2010 that makes searching your C#, C, and C++ code as easy as using Google.         

VS Gallery Download: http://bit.ly/SandoDownload
 

Getting Started With Sando

Picture

After installing Sando the main view will appear in your Visual Studio Studio, as shown to the left.  The UI consists of the main input box (upper left), the search button (upper right), the results view (bottom center) and the normally folded advanced options (middle center). To use Sando simply open a solution, type in a search term, and press search (or hit return).

Picture

 Once you search, you'll see results like those shown to the left.  Notice how the method OpenFile is shown first, because it matches both search terms, whereas the lower ranked terms only match one of the two terms.  Each result is shown with a representative icon that communicates both the element type (e.g., method, class, or plaintext) and the accessibility level if relevant (e.g., public or private).

Picture

See a result you like but not ready to commit to opening it? No problem, after the search is executed just press the down arrow to scroll through results, expanding each result to view a partial snippet when it is selected.  In the picture to the left OpenFile has been selected and you can view the first few lines of this method.  To open the method in the VS editor simply hit return or double click on the result.

Getting Fancy with Sando

So far we've discussed the very basics of how to use Sando.  However, the entire Sando team dog-foods Sando (i.e., we use it everyday ourselves) and so it's got a few advanced features baked in, which I'll discuss here.

Picture

 Halfway through your task and decide you need to search again? No need to pickup that mouse, Sando is designed to allow you to work mouse-free.  Hit Alt+Shift+S and the Sando view will appear with the cursor in the text box, ready to search.  Using this shortcut I find Sando to be a great way to open any file or method I'm thinking of, and thus I almost never open the Solution Explorer.  

Picture

One of the things we noticed when using Sando is that sometimes you just don't want to see certain results.  For instance, we have huge text files of words in our test directories, which are indexed by Sando, but sometimes we don't want to see these results.  In the advanced section of Sando you can deselect any program type, such as a method or a comment, or any other type, such as a text line. Doing so means that deselected types won't appear in your results.  This provides a quick way to eliminate unwanted items from your current search.

Picture

You may have noticed that Sando often changes the text just under its main input box.  This is the status line and it is used to give you feedback on your query.  If your query has hits it will tell you how many, and if it doesn't Sando may give you tips on how to improve your query.  You may also notice the message that "Sando is still performing its initial index...". This occurs when you open a new project that Sando has not analyzed before.  This only happens once and, when analyzing Sando itself, takes only ~1 minute to complete on a 1.7GHz machine with no SSD.  For a machine with SSD I've seen this index happen almost instantly for sizable projects. Note that this indexing is necessary for Sando to be able to return search results virtually instantly on even *very* large Solutions.   

Picture

Finally, while we've done our best to choose good defaults for most users, you may want to customize a few things.  To do this, visit the Sando options page (Tools > Options) where you can configure the directory where Sando stores its index as well as the maximum number of results returned, which is by default set to 20. I recommend resetting this to 50, but I'm crazy about search so I didn't force this default on the masses...  

Search With Style

Hopefully this post gives you a good idea of the functionality that Sando provides.  My team and I have spent many a late night improving Sando based on early adopters' feedback and we truly think this release represents a big step forward in usability and robustness.  If you have been using Sando now's the time to start recommending it to your friends. If you have been considering using Sando, you should now enjoy a much improved experience. Next time you search, I hope it's Sando Style!


VS Gallery Download: http://bit.ly/SandoDownload  
Video Introduction (dated): http://bit.ly/SandoVideo

 

Published at DZone with permission of David Shepherd, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)