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.
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!