In-Depth

Hands On with Latest Visual Studio 2022 Preview Features

Each edition of Visual Studio comes with hidden preview features that can be unlocked to try out brand-new functionality that hasn't yet been baked into the IDE, with the purpose being the collection of developer feedback so Microsoft can decide if those features should become standard, or what should be done to improve them first.

I decided to try out a couple of preview features available in the just-released Visual Studio 2022 v17.3 Preview 2, primarily known for being the first edition to come as a native Arm64 application on Windows 11.

The preview features are enabled by clicking Options on the Tools menu and then selecting the Environment > Preview Features page. Alternatively, you can just enter "preview features" into the Visual Studio Search box after pressing Ctrl+Q to move focus to the Search box.

Preview Features Dialog Box
[Click on image for larger view.] Preview Features Dialog Box

As the above graphic shows, there are a bunch of them, with most already pre-checked for enablement (this is a preview edition of the IDE, after all).

Here's what I found out trying a couple of preview features having to do with new audio cues and a new search experience.

Audio Cues
Preview 2 actually introduced three new audio cues in response to a June 2021 Develop Community post appropriately titled "More Audio Cues for Visual Studio." It was authored by Microsoft's Dante Gagne, who said: "Visual Studio used to have the ability to cause a WAV file to be played when certain events were hit. Today, you can do this with things like a breakpoint interrupting execution during a debugging session or a test run failing. These cues can be configured by using the 'Change System Sounds' command in Windows 10. Particularly for screen reader users, it would be useful to have more options to attach audio cues. How about an audio cue when the user arrives on a line with a breakpoint? What about when a find in files operation is finished?"

He solicited suggestions for new audio cues in addition to his breakpoint example, and developers chimed in with suggestions that were actually enacted (navigating to lines with warnings or errors) and some that weren't (navigating to a line with a lightbulb indicating that Quick Actions are available).

Gagne followed up with an update on his effort with a June 22 blog post titled "Listen Up, Visual Studio has a new feature you need to hear about!"

"Our accessibility journey in Visual Studio has taught us that developers love to customize their experiences to help them be productive," he said. "Some developers have been telling us that they want to use sound to help them understand what's happening in their code. A short, simple sound when the caret arrives on a line with an error can quickly help some developers understand where their attention needs to be. Visual Studio Code introduced a handful of these audio cues, and many developers love them. We're happy to bring them to Visual Studio."

Now, the list of preview features includes this entry:

  Enable Audio Cues for the Editor
  Enable Audio Cues when navigating to lines with breakpoints, warnings, or errors

It's hard to describe sounds, but each of the three new audio cues has a different sound, either a single tone for a warning or longer tone sequences for errors and breakpoints. They can actually be heard -- and customized -- by going to the Sound control panel on Windows 10/11 machines.

You can do that by simply pressing the Windows button and searching for "Change System Sounds," after which Windows will display the Sound control panel. "You can scroll down in the Program Events box for the 'Microsoft Visual Studio' events," Gagne said. "The new events are 'Line has Breakpoint,' 'Line has Error,' and 'Line has Warning.' The Sound control panel lets you customize each of these sounds to any .wav file you like or disable a specific sound by setting the Sounds field to (None)."

Sound Control Panel
[Click on image for larger view.] Sound Control Panel

However, I couldn't choose from the large selection of .wav files available in the Sound control panel to customize the three new audio cues. For each of the three new cues, my only options were the three .wav files already assigned to them: breakpoint.wav, error.wav and warning.wav. Those were also the only three options available for the other program events that are listed under the Microsoft Visual Studio section of the Sound control panel, whereas other program events could be associated with any one of dozens of available .wav files.

I have no idea why, but your mileage may well vary.

All-In-One Search
An All-In-One searching experience for finding symbols in code, IDE features, files and more was introduced in Visual Studio 17.2 Preview 3 as detailed in April 25 Visual Studio Magazine article appropriately titled "Visual Studio 2022 17.2 Preview 3 Intros All-In-One Search."

These search enhancements come from a April 19 Developer Community post authored by product manager Denizhan Yigitbas, who said: "In Visual Studio 17.2 Preview 3, we released a brand new search experience called the All-In-One Search that empowers developers to search their loaded code and Visual Studio features in the same, light-weight UI.

"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. You can enjoy a real-time, instant response search experience with a customizable (size, location, and dismissibility) and fully keyboard friendly UI."

This functionality is provided by enabling this preview feature:

  New Visual Studio Search experience (restart required)
  Enables an All-in-one Search experience that replaces Visual Studio Search (Ctrl+Q) experience along with Go To (Ctrl+T)

It merges existing keyboard shortcuts (Ctrl + Q) -- for the Search box at the top -- and (Ctrl+T) -- for the Go to All box, along with (Ctrl+,), which is the same shortcut as (Ctrl+T).

One enabled, pressing Ctrl+Q doesn't just bring you to the Search box at the top of the IDE as usual

 Standard Search
[Click on image for larger view.] Standard Search

but rather triggers a popup dialog with Code Search and Feature Search tabs, shown here:

Preview All-In-One Search
[Click on image for larger view.] Preview All-In-One Search

With the new experience, the Search box at the top of the IDE also provides dropdown options for Code Search and Feature Search.

The Code Search tab in the popup (or Search dropdown) helps find the exact place where a symbol (class, method, function, variable and so on) is defined, instead of just matching a search text string. It provides three types of results, which can be filtered with buttons for:

  • Files: Search for any file type located anywhere in your loaded code in VS
  • Types: Search for definitions of classes, interfaces, enums and types
  • Members: Search for definitions of members defined in classes and types
New Search in Action
[Click on image for larger, animated GIF view.] New Search in Action (source: Microsoft).

"The Feature Search tab in the All-In-One Search experience allows you search for Visual Studio menus, options, components and templates," said Yigitbas in an April 20 blog post. "For example, I can easily launch the Solution Explorer or even search for Git functionalities all within this search experience. It's now easier to achieve exactly what you want without the need to navigate through various menus!"

Yigitbas followed up with a May 17 post about enhanced functionality including:

  • The overlay checkbox has been replaced by a pin icon: "The previous version of All-In-One Search allowed you to keep the search window open even when focus was not on the window. This feature enables developers to continue to view search results while coding, keep the search window on a different monitor, and more. The dismissal state for this window was determined by a 'Keep search window open' checkbox at the top right of the window. We have replaced this checkbox with a pin icon. When pointing to the left, the window will be in dismissible mode. If clicked, the pin icon will point down, indicating that the window is now in sticky mode."
    Keep Search Open
    [Click on image for larger, animated GIF view.] Keep Search Open (source: Microsoft).
  • Absolute file paths have been replaced with relative file paths: "In 17.2, each search result, whether file, type, or member, displayed the absolute file path of where the match was. This means that the file path always started at the root. Often times, the root information doesn't provide developers with essential information needed to differentiate between results. This is why we are now replacing the absolute file paths with relative file paths. The relative file path will provide the information needed starting from the solution directory rather than the root of your machine."
  • Relative file paths are now right aligned to separate from symbol information: "Along with replacing absolute file paths with relative file paths, we have separated the symbol information from the file path. The file path is now right aligned while the symbol information remains left aligned. The goal of right-aligning the file path is to add structure to this result list to make it easier to quickly glance and select the desired search match you are looking for."

Many Other Options
As noted, there are a bunch more preview features that aren't pre-checked for enablement.

For just a few examples, you might want to try:

  • All IntelliCode preview features (requires restart)
  • Allow out-of-process load and evaluation of projects (requires restart)
  • Enable port tunneling for Web applications
  • Multi-repo support (requires Solution reload)
  • Log incremental build failure warnings in build output
  • Prioritize performance (requires restart)

Regarding the latter item, I have no idea why it would be a choice and not already baked in, or at least enabled.

I mean, who wouldn't want a feature that "Prioritizes memory allocation and system resources for better performance in Visual Studio and other tools?"

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