New: Better search in Visual Studio
Whether you are looking for specific code files, classes, methods, or features and options in the IDE, finding them is not always easy. With multiple ways to search, how would you even know which one to choose? The new All-In-One Search combines code and feature search into the same UI and adds some extra power and productivity to the experience.
To enable the new search experience, go to Tools > Options > Environment > Preview Features > New Visual Studio Search Experience. After doing that, and restarting Visual Studio, you’ll now see the new search button appear in the title bar, as shown in the screenshot below.
Ctrl + T for code search and Ctrl + Q for feature search stay the same, so your muscle memory remains intact.
Quickly find files, symbols, and Visual Studio features
Results for files, types, and members are prioritized in the Code Search tab (Ctrl + T) to help you navigate directly to the places where symbols are used. You can further narrow your search to just one of these filters with the buttons below the search bar or by prefixing your search with “f:’, “t:”, or “m:”.
In addition to fast symbol navigation, the Feature Search tab (Ctrl + Q) provides easy access to the various tools, options, templates, and components available in Visual Studio.
Preview and edit your code in the search window
Alongside your list of search results, you’ll see a preview of the selected result. You can glance over to get immediate context of a result without needing to open it and even make tweaks to your code right in the search window. All file types, C# types and members, and C++ types and members are supported in the preview panel.
Configure the preview location by toggling the icons at the top right of the window.
To see the new all-in-one search in action, check out this short demo video:
Try out the new search experience early in the 17.5 Preview builds! What do you think about the new search? Let us know in the comments below.
Man, and I just renewed my Visual Assist subscription for another year! 😂
Seriously though, I’m glad that the team is working on features that we have had to get from a third-party for so many years.
Looks good. I wonder if a single, omni- search would be nice.
I can’t say why, but the search in the title bar (which was for searching for VS features) has become completely broken for me in the newer releases. It was fast and effective when you guys first released it a few years back, in the newer releases it returns terrible results or just hangs VS completely.
Hello MgSam, I’m sorry to hear that you’ve been hitting issues with the search experience. We’re working on improving the reliability and it would really help us if you could share your experience.
Do you have any examples you can share of when it returns terrible results?
And if you encounter hanging issues again, would you be able to follow the instructions on this page to help us figure out the issue?
Odd, I’m running VS 17.4.4 and I don’t seem to see this option as posted herein. What version is this available in just the latest previews?
I don’t see it either on VS 17.4.4.
As of now you need to be on version 17.5.0 preview.
Would have been nice if the main article stated this
Hello Larry, this new search experience is available in the 17.5 previews. Thank you for asking this question! I will update the blog post to reflect this.
One feature that’s nice in JetBrains IDEs is that their equivalent search looks into library symbols as well (e.g. dependencies). This can be useful when you’re trying to look through a library to study the API etc. I notice that this feature doesn’t do that, but I think it would be a good idea to have as an option.
Thank you for the suggestion Sunil! Would you be able to comment this on this Developer Community ticket to help us keep track of the feedback?
Looks good. However, this feature seems to be in perpetual preview. You’ve been talking about it since 17.2 preview 3, back in April, and it has yet to appear in any non-preview version of Visual Studio.
I appreciate there may still be areas where it can be improved. But surely there has to come a point where what you’ve got is good enough to replace the current search, and it gets pushed to the release channel?
I’m relieved to know I’m not the only one who was wondering about this. If I’m not mistaken based on my Googling and Bing’ing (“site:devblogs.microsoft.com all-in-one search”), this is the fourth post about this preview feature, and I’m having trouble discerning what if anything has been changed since the last update post in June. Posting about the same preview feature over and over for an extended period of time causes confusion, as is evident from some of the other comments here — at some point readers will simply assume the feature has shipped for real!
I eagerly await the day it ships, nonetheless!
Thanks for your comments Richard and Josh! We’ve been working hard to ensure that this feature is ready to replace parts of the current search experience. Since it’s such a high traffic feature, we’re taking extra care on both visible (UI) and more hidden (performance) aspects to make sure we’re getting it right. We believe we’re nearing the finish line, so stay tuned for updates! We would love to hear if you think this feature is ready (or not), so let us know what you think by submitting feedback on this ticket in Developer Community.
That makes a lot of sense as to why you’re taking so long to replace it. Depending on how well it does, you might break my VS Extension habit. 😉
I have the latest version of Studio 2022 and ‘Preview Features’ is not available when I searched for Search.
I find it useful to search sub directories within an application. I use Visual Studio Code for this. It’s helpful to distinguish between application code and third party products such as Bootstrap when searching.
Are you on the preview version? You need to be on 17.5.0 preview. I was able to search that on the preview version and it showed up.
Hello Roland, I wanted to confirm that this new search experience is available in the Preview channel version 17.5.0 and on. I’ve updated the blog post to clarify this. Thank you for asking!
Been waiting since april for this… wish it would make it to the release branch already.
I’m glad to heard that you’re excited for it to be released Devon! We’ve been working hard to ensure that this feature is ready to replace parts of the current search experience. Since it’s such a high traffic feature, we’re taking extra care on both visible (UI) and more hidden (performance) aspects to make sure we’re getting it right. We believe we’re nearing the finish line, so stay tuned for updates! If you’ve been able to try it out, we would love to hear if you think this feature is ready (or not), so let us know what you think by submitting feedback on this ticket in Developer Community.
Nice! I’d really like to see improvement in the “Find All References/Usages” panel, see a comparison with the Jetbrains one here
How can we search a Class (or interface/enum) from lib ? (c#) ReSharper and Rider can do it easily.
Can you please provide a link to the documentation of what a 3rd party vendor needs to do to be included in this new Search Feature?
Can I change the keyboard binding to CTRL-F?
The preview in Ctl-T is NOT editable (I can weirdly insert new line but NOT type code).
The new search is very promising–and quite fast. However, it doesn’t search through my .VUE files. Can you configure what files in the project get searched?
Looks good, but sometimes when I use shortcut to search for files, the input field selects the whole line, including “f:” instead of the right part only. So I accidentally search for all code instead of just files, which makes it pretty unusable. It usually happens after a few searches, not in the beginning.
Hi. In the old version, Alt + \ will to search member from current class, now it will search all class. How to search member only in current class or file.
When I use Alt + \ I want to search just the current class or file. The speed of the new search in Ctrl + T is very impressive, but I would at least want the results from the current class to be on top.
That’s very great news, but still no case sensitive, whole word search. It looks great but almost unusable.