Sneak Peek and Edit Your Code While You Search
Throughout Visual Studio 2022 Previews, we’ve been releasing a series of changes to the way you go about searching code in the IDE using the new All-In-One Search:
- VS 2022 17.1 Preview 1: Indexed Find in Files
- VS 2022 17.2 Preview 3: The New All-In-One Search
- VS 2022 17.3 Preview 1: All-In-One Search UI Cleanup
Now, in 17.3 Preview 2, we’re releasing a new feature to the new All-In-One Search to help you search and interact with code more efficiently: Contextual Code Previews. This new code preview introduces the ability to not only preview your code search results, but also make edits to your code all within the All-In-One Search UI (use Ctrl+t or Ctrl+q to launch). The additional context provided by the code preview will allow you to differentiate between search results within seconds, making it easier than ever to find exactly what you’re looking for. With the ability to edit code right from the search window, you’ll be able to stay focused on your code and quickly make changes using the same experience you’ve come to know and love in the full Visual Studio editor. You’ll find full support for IntelliSense, Quick Actions, refactorings, and more without ever needing to leave the search UI.
Full Editor Experience all within the search UI
The code preview in the search UI intends to provide you a full editor experience. This means that you can not only differentiate similarly named symbols, but also make changes to your code. Enjoy some of your favorite editor features including IntelliSense, refactor, find all references, and more, all without leaving the search window.
Configurable Experience
We know that every developer has a unique setup that optimizes their development experience. Some might prefer ultra-wide screens, and some might prefer portrait mode screens. For this reason, the code preview has 3 various configurations:
- Vertical Configuration: Select the vertical split icon located at the top right of the search window. Code Preview will be below the results section.
- Horizontal Configuration: Select the horizontal split icon located at the top right of the search window. Code Preview will be to the right of the results section.
- No Code Preview: Toggle either icon to disable code previews.
Try it out and share your feedback!
To try the new code preview experience in the All-In-One Search, please download Visual Studio 2022 Preview
To enable the new search experience, go to Tools > Options > Environment > Preview Features > New Visual Studio Search Experience. We would love to get your feedback on the new search experience so please give it a try and let us know what you think! You can share any feedback via this suggestion ticket and leave comments with any thoughts!
9 comments
The all in one search does not have a good understanding of c++ code compared against the older search. So unless that improves, I don’t foresee using this experience. Yes, it’s been reported via the feedback UI.
Hi Thanks for all your hard work.
I just wanted to bring to your attention that this is causing a massive amount of disc usage (or at least I believe it is).
I got a brand new Windows 11 installed on ARM.
I then installed Preview Build of Microsoft Visual Studio Community 2022 (ARM 64-bit) – Preview
Version 17.3.0 Preview 5.0
and loaded an existing solution that I have been running in VS 2019.
My disc, after about 1 hour, become completely full. After searching, I discovered that
[MyProjectFolder]/.vs/[MyProjectName]/FileContentInex/Merges folder was 197GBs in size.
I deleted the folder and then launched VS again and it immediately began to fill up.
I’d say this is unusable if it takes up that much space to index.
The option to disable this feature is no longer in Tools/Options/Environment/Preview Features as per this article:
https://stackoverflow.com/questions/72237599/how-to-disable-that-new-filecontentindex-folder-and-vsidx-files-in-vs-2022
Thanks for looking into this.
I would recommend to improve the search window before it goes to life as most of the people wont be happy with those changes.
Before it was small and smart text field in the right corner, now it is a big popup window in the middle of the screen which requires few seconds to appear.
I used to paste file name or method name by clicking Ctrl+, Ctrl+v, now my search phrase got pasted into the code not into the search window, because the search window is not shown at the moment. It is so annoing. As well as the serch itself is much slower than it was before.
Hi Denizhan,
Thanks for the improvements on search tool.
Any chance to show some love on find and replace (Ctrl + F) search ?
The animation at the top of the post doesn’t work for me: it quickly flashes the screen and nothing happens. I’ve not had this issue with other similar videos/animations in other posts here so I assume it is a problem in the article itself and not on my machine.
Thanks for the heads up Juliano! This should be fixed now 🙂 let me know if it isn’t
Looks good. Commands Edit.GoToFile and GoToMember work correctly.
But one feature is missing – GoToMemberInCurrentDocument. Please add this and ‘Code search’ will be feature complete.
Also add an option to hide the bar below “Document Tabs”.
> Also add an option to hide the bar below “Document Tabs”.
Note this exists, although admittedly hard to find:
– Tools | Options, pick a code language (or “All Languages”), General, Settings, enable/disable “Navigation bar.”
Thanks for this feedback Jaroslaw! I am actively looking into this the GoToMemberInCurrentDocument 🙂 Appreciate your input!