News

Visual Studio 2022 Preview Allows Code Editing in Search Results

In the latest Visual Studio 2022 preview, developers can edit source code from within All-In-One Search results.

That's the latest search improvement from the dev team, which in April revamped the IDE's search experience in a VS 2022 v17.2 preview that introduced All-In-One Search, providing a one-stop-shop, lightweight, customizable and easily dismissible search popup, which can be kept open and even moved to another monitor for an easier searching/coding experience.

"The new search experience includes a symbol search for looking up file names, types (including classes, interfaces, enums, and types), and members (methods and properties within a class) as well as a feature search to look up Visual Studio related functionalities," Microsof said at the time. "You can enjoy a real-time, instant response search experience with a customizable (size, location, and dismissibility) and fully keyboard friendly UI."

In VS 2022 v17.3 Preview 2, the new functionality comes via Contextual Code Previews, which lets developers preview and make edits to search results within the search popup, mimicking a full editor experience. For example, beyond making code changes, it helps developers differentiate between similarly named symbols and leverage editor features like "Find all references."

"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," said Denizhan Yigitbas, product manager, in a June 27 blog post. "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."

Editing Search Results in Animated Action
[Click on image for larger, animated GIF view.] Editing Search Results in Animated Action (source: Microsoft).

Customization of the UI display is also available, as developers can toggle among icons displayed at the top of the search window to have results displayed above the code in a vertical configuration or to the right of the code in a horizontal configuration. A third option disables the code previews completely.

The new search experience can be enabled from the top menu: Tools > Options > Environment > Preview Features > New Visual Studio Search Experience.

We put the new All-In-One Search functionality through its paces in last week's Visual Studio Magazine article "Hands On with Latest Visual Studio 2022 Preview Features," along with audio cues.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube