<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx</link><description>Argh! I wish I had found this one in time for the book. A second edition, maybe? I’d hate to be known as a one-hit wonder. I’m sure there are more people who could use scholarship money. Ever did a Find in Files and was annoyed that Visual Studio showed</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>infoblog &amp;raquo; Did you know??? You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9136777</link><pubDate>Mon, 24 Nov 2008 14:08:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9136777</guid><dc:creator>infoblog &amp;raquo; Did you know??? You can customize how search results are displayed in the Find Results window? - #363</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.a-foton.ru/index.php/2008/11/24/did-you-know%e2%80%a6-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363/"&gt;http://blog.a-foton.ru/index.php/2008/11/24/did-you-know%e2%80%a6-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9136988</link><pubDate>Mon, 24 Nov 2008 15:37:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9136988</guid><dc:creator>Perley</dc:creator><description>&lt;p&gt;Now if we can get it so that Search Entire Project doesn't go through the generated xml files or Search All Open Documents only searched the opened documents...&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9137355</link><pubDate>Mon, 24 Nov 2008 17:49:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9137355</guid><dc:creator>Michael Stum</dc:creator><description>&lt;p&gt;This is possibly one of the most excellent VS Tips ever. Thanks! :-)&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9137361</link><pubDate>Mon, 24 Nov 2008 17:51:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9137361</guid><dc:creator>Antonio</dc:creator><description>&lt;p&gt;Hey! this one is really good!!! &lt;/p&gt;
&lt;p&gt;I&amp;#180;m really annoyed with this &amp;quot;entire file path&amp;quot; format in the find results window. But not anymore!!! Thanks to you, Sara!!!&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9138023</link><pubDate>Mon, 24 Nov 2008 20:42:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9138023</guid><dc:creator>Mike Chess</dc:creator><description>&lt;p&gt;Sara,&lt;/p&gt;
&lt;p&gt;This is one of those things that Visual Studio really needs to expose through a configuration dialog. &amp;nbsp;The ability to customize the search results shouldn't be hidden away in a registry hack. &amp;nbsp;It couldn't be that hard to add to the Options dialog ...&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9138808</link><pubDate>Mon, 24 Nov 2008 23:36:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9138808</guid><dc:creator>MarcT</dc:creator><description>&lt;p&gt;Sweet! Secret registry ninja powers! Go Sara Go!&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9140251</link><pubDate>Tue, 25 Nov 2008 05:42:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9140251</guid><dc:creator>ez</dc:creator><description>&lt;p&gt;Really hard stuff for today! More like this!&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9142317</link><pubDate>Tue, 25 Nov 2008 19:42:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9142317</guid><dc:creator>Knobloch</dc:creator><description>&lt;p&gt;Now, is there any way to get a relative path working? (Artifacts\MyArtifact.cs rather than C:\blah\blah\blah\...\Artifacts\MyArtifact.cs or just MyArtifact.cs?&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9142348</link><pubDate>Tue, 25 Nov 2008 19:55:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9142348</guid><dc:creator>redjoy</dc:creator><description>&lt;p&gt;This is a great one. All my paths are several layers deep. Now it is only one dir deep. :)&lt;/p&gt;
&lt;p&gt;Question: Can you put any RegEx in?&lt;/p&gt;
&lt;p&gt;I was thinking that I might want the last portion of the directory plus the filename.&lt;/p&gt;
&lt;p&gt;Instead of:&lt;/p&gt;
&lt;p&gt;c:\projects\SolutionDir\ProjDir\Filename.cs(x,y): blah, blah, blah.&lt;/p&gt;
&lt;p&gt;I would rather see:&lt;/p&gt;
&lt;p&gt; ProjDir\Filename.cs(x,y): blah, blah, blah.&lt;/p&gt;
&lt;p&gt;Any comments/suggestions?&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9143768</link><pubDate>Wed, 26 Nov 2008 13:13:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9143768</guid><dc:creator>Sverker Nordlund</dc:creator><description>&lt;p&gt;Great one! Works prefect! &lt;/p&gt;
&lt;p&gt;Is there anyway to do the same for &amp;quot;Find Symbol Results&amp;quot; for &amp;quot;Find all references&amp;quot;? I tried to add a simular key &amp;quot;Find symbol format&amp;quot; and also &amp;quot;Find reference format&amp;quot;, but nothing happend. &lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9144576</link><pubDate>Wed, 26 Nov 2008 18:06:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9144576</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Thank You!!! &amp;nbsp;Best. Tip. Ever!&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9159631</link><pubDate>Mon, 01 Dec 2008 08:59:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9159631</guid><dc:creator>Mahendran Shanmugham</dc:creator><description>&lt;p&gt;Excellent feature! &amp;nbsp;Thanks Sara!&lt;/p&gt;
&lt;p&gt;Mahendran Shanmugham&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9172328</link><pubDate>Thu, 04 Dec 2008 02:28:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9172328</guid><dc:creator>Chris Harang</dc:creator><description>&lt;p&gt;I cannot believe this is not exposed somewhere! &amp;nbsp;What a missed opportunity for a huge potential added value.&lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9181024</link><pubDate>Sat, 06 Dec 2008 09:17:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9181024</guid><dc:creator>rhettc</dc:creator><description>&lt;p&gt;Awesome! &amp;nbsp;I rarely used FiF for that reason and instead used a GREP tool (powerful but seperate from the IDE) or Symbol search when I could. &amp;nbsp;Like other readers I couldn't wait to get rid of the path, but since we can include new lines and show a multi-line match, you have space for both.&lt;/p&gt;
&lt;p&gt;My first format string, however, is focused on the search text. &amp;nbsp;Also, I took liberties in creating another string value in the registry &amp;quot;Find result format_01&amp;quot; just to have a backup while messing around.&lt;/p&gt;
&lt;p&gt;Here's my first custom format string:&lt;/p&gt;
&lt;p&gt;$l\t$n\n$0\n********************\n&lt;/p&gt;
&lt;p&gt;Which is:&lt;/p&gt;
&lt;p&gt;&amp;lt;line num&amp;gt; &amp;nbsp;&amp;lt;fileNm&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;SEARCH &amp;nbsp;MATCH ....wraps as needed&amp;gt;&lt;/p&gt;
&lt;p&gt;*******************&lt;/p&gt;
&lt;p&gt;As the matches are listed the stars serve as your cheap, but effective result boundaries. &amp;nbsp;Putting the line num before the file creates a more predictable location (imo) then tacking the numbers on at the end of the name/path.&lt;/p&gt;
&lt;p&gt;So... We can start up the find in files window, put it in RegEx Mode, and put the following in the Find What box:&lt;/p&gt;
&lt;p&gt;(~(^:b+'))(~:b).+&amp;lt;From&amp;gt;(.|\n)@[^_]$&lt;/p&gt;
&lt;p&gt;Run the search and you get a list of the LINQ queries w/in your search scope. &amp;nbsp;Using the new formrat string, you can see the entire query. &amp;nbsp;No more double clicking a result, reviewing the file, and realizing... oh wait, no, not that, maybe this one ... &amp;nbsp;&lt;/p&gt;
&lt;p&gt;A few limitations with that pattern:&lt;/p&gt;
&lt;p&gt;-The expression is written to match VB. &lt;/p&gt;
&lt;p&gt;-There may be a few a false positives. &amp;nbsp;The RegEx flavor in VS leaves a bit to be desired. &amp;nbsp;Maybe in 2010 VS will get the same first-class RegEx engine found in the framework. &amp;nbsp;Probably a licensing issue that's being worked out as we speak ;)&lt;/p&gt;
&lt;p&gt;-The double-click to go to result will no longer work right after the first result that spans more than one line. &amp;nbsp;Multi-line results will cause the result window's index position to get out of sync with the actual results. &amp;nbsp;It is (seemingly) incremented with each new line in the window. &amp;nbsp;In fairness, the flexibility of the format string can leave you with results that start and stop in the middle of a line if you aren't careful. &amp;nbsp;Maybe this issue has something to do with this format string feature being kept on the D/L. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here's another pattern for the expanded results window: &amp;nbsp;Find Catch blocks without an explicit Throw statement. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;(^{:b+}Catch.*\n)((~(^:b+Throw&amp;gt;.*\n).*\n)@)(^\1End:bTry)&lt;/p&gt;
&lt;p&gt;As before, it's written for VB syntax, but could probably be updated for C# w/o too much work. &amp;nbsp;The expression is capable of handling nested Try blocks, to a small degree... &amp;nbsp;It's not a proper parser, it's just looking for 'interesting' code.&lt;/p&gt;
&lt;p&gt;Last one, I promise, maybe. &amp;nbsp;This is just a fragment. &amp;nbsp;You fill in the %BLANK% with the search expresion of your choice and replace the two # characters with the number of context lines above and below your match that will be shown. &amp;nbsp;Note: if there aren't enough lines above and below the match then the match attempt fails. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;((^.*$\n)^#).@(%BLANK%)([^\n]+)(\n.*)^#&lt;/p&gt;
&lt;p&gt;Other readers asked about including only parts of the path, either display a relative path or the parent folder of the file with results. &amp;nbsp;I didn't see any format tokens that would do that. &amp;nbsp;But, this quick and dirty RegEx could be worked into a VS macro that could do the trick. &amp;nbsp;The literal characters of the expression defines a root path that will not be captured in any named group. &amp;nbsp;The 'Relative' group gets the folder from the root all the way to the file. &amp;nbsp;The 'ParentFolder' group will get you the name of the folder that contains the file&lt;/p&gt;
&lt;p&gt;(?:^ *C:\\Visual Studio Projects\\(?&amp;lt;relative&amp;gt;(?&amp;lt;parentFolder&amp;gt;\w+\\)+)(?&amp;lt;file&amp;gt;\w*.\w+(?:[.]\w+)*)\(\d+\):)\s+&lt;/p&gt;
&lt;p&gt;I could provide explanations of the patterns I've posted.&lt;/p&gt;
&lt;p&gt;Thanks for tip! &lt;/p&gt;</description></item><item><title>re: Did you know… You can customize how search results are displayed in the Find Results window? - #363</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9282496</link><pubDate>Mon, 05 Jan 2009 21:20:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9282496</guid><dc:creator>MartinC</dc:creator><description>&lt;p&gt;Wonderful! &amp;nbsp;Thank-you.&lt;/p&gt;
&lt;p&gt;This also works on Express versions but the registry keys are different, e.g. for Visual C# 2008 Express it is &lt;/p&gt;
&lt;p&gt;HKCU\Software\Microsoft\VCSExpress\9.0\Find&lt;/p&gt;</description></item><item><title>Visual Studio 2008 每日提示(三十六)</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9541964</link><pubDate>Fri, 10 Apr 2009 04:27:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9541964</guid><dc:creator>xjb</dc:creator><description>&lt;p&gt;本篇包括tip361-tip370&lt;a rel="nofollow" target="_new" href="http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-36.html#361"&gt;http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-36.html#361&lt;/a&gt;、按...&lt;/p&gt;
</description></item><item><title>DevDays 09 – 24 Visual Studio Tips</title><link>http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx#9646548</link><pubDate>Thu, 28 May 2009 12:04:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9646548</guid><dc:creator>Sara Ford's Weblog</dc:creator><description>&lt;p&gt;Tip #0 Know your Keybindings! General Development Settings Searching Tips Tip #1 How to behold the power&lt;/p&gt;
</description></item></channel></rss>