Follow us on X (Twitter)  Like us on Facebook  Connect with us on LinkedIn  Subscribe to our YouTube Channel  Subscribe to our WhatsApp Group

Visual Studio Productivity Tips: Limit search results to filename only


Visual Studio Productivity Tips: When you search for a term in the Find and Replace dialog window, it displays the result with matched file name along with the matched code line. Using this search trick, you can drill down the search result to a list of file names where the search term is present. - Article authored by Kunal Chowdhury on .

When you search for a text in Visual Studio, by default it lists the matched code block along with the file name in the search result. But, some time just listing the file name is enough to focus on where the text is available.

 

Visual Studio provides an option to drill down the search result and to keep you focused on what you wanted to view. In this part of my Visual Studio Productivity Tips series, let's learn how to do that.


Visual Studio Productivity Tips:


 

Visual Studio Productivity Tips: Limit search results to filename only

 

When you search for a term in the Find and Replace dialog window, it displays the result with matched file name along with the matched code line. Its the default view of the Find Results dialog. As shown in the below screenshot, it contains the file name (left) and the matched line (right) in the result window:

 

When you search for a term in the Find and Replace dialog window, it displays the result with matched file name along with the matched code line

 

When you would like to focus only to the file names, where the term is present, invoke the Find and Replace dialog and select the Display file names only under the Result options, before hitting "Find" as shown below:

 

Visual Studio 'Find and Replace' dialog window

 

This will result a list of file names where the search term is present. Thus, narrows down the search and helps you to focus on what you want to view. Here's a screenshot that you would like to refer:

 

This results a list of file names where the search term is present

 

I hope that this quick tip will help you next time when you hit search in your Visual Studio editor. Don't forget to share this trick with your friends and colleague.

 

 

Have a question? Or, a comment? Let's Discuss it below...

Thank you for visiting our website!

We value your engagement and would love to hear your thoughts. Don't forget to leave a comment below to share your feedback, opinions, or questions.

We believe in fostering an interactive and inclusive community, and your comments play a crucial role in creating that environment.