Visual Studio 2022 17.8 Preview 1 has arrived!
Hot on the heels of the General Availability of Visual Studio v17.7, (Visual Studio 2022 – 17.7 Now Available) we’re thrilled to introduce the next set of enhancements that aim to streamline your workflow and boost your productivity.
In this preview, we’re bringing you features that can significantly improve your day-to-day tasks. From creating a PR directly within Visual Studio to a case-preserving search & replace across multiple files, we’re making your tasks simpler and more efficient. We’ve also extended IntelliTest support for .NET 6+ and .NET Standard, making it easier to generate and manage unit tests
With something for every developer, browse this comprehensive list of enhancements and let us know which of these enhancements is your favorite:
|C++ and Game Development
|Debugging and Diagnostics
You can delve into the complete list of enhancements by checking out the Visual Studio 2022 17.8 Preview 1 Release Notes, and we always love to know what you think with feedback through Developer Community: reports of any bugs or issues via report a problem and share your suggestions for new features or improvements to existing ones.
Add Reviewers to your Pull Requests
We see lots of engagement on this Developer Community ticket. In response, we are improving on the pull request experience added in preview 17.7, and you can now add your reviewers to your pull requests in Visual Studio for both Azure DevOps and GitHub.
Try this out by clicking on the “Create a Pull Request” link that appears on push, or by selecting Git > GitHub or Azure DevOps > New Pull Request from the top level menu. Then, navigate to the Reviewers section and search for the reviewers you’d like to add.
We plan to continue making updates to improve this pull request experience, so please share your feedback about this feature here.
As a continuation of our efforts to improve the diffing experience in Visual Studio, we’ve implemented the Summary view in the diff and compare views. This new option allows you to see only the changes in the file with a few lines of context, making reviewing your changes in a commit or the comparison between two files much more efficient.
Multi-Repo Limit Increase
As more of you are using our Multi-repository features, we heard on this Developer Community suggestion ticket that many of you needed the number of active repositories to be more than 10. You can now work with up to 25 repositories at once in your solution.
Case Preserving Find and Replace
When you do a Replace, you can now preserve the original casing of each match in your code. Note that to get Pascal case and Camel case, your Replace string must also be in Pascal case or Camel case.
Toggle case preservation in the Replace window with ‘Alt+V’ or by clicking on the ‘Preserve case’ option.
Quick Replace (Ctrl+H):
Replace in Files (Ctrl+Shift+H):
Share your thoughts on the case preserving replace experience on this ticket: Case-Preserving Search & Replace Across Multiple Files.
C++ and game development
Unreal Engine Snippets
Unreal Engine specific snippets are now available in Visual Studio 2022. As a preview feature, we have included a list of common core Unreal Engine macro snippets. To begin, start typing in the editor window and UE snippets will start showing up as a member list item in your Unreal Engine projects. Press tab or enter to create the snippet.
List of Supported Snippets
Unreal Engine Test Adapter
You can now see your Unreal Engine tests from within Visual Studio with the new UE Test Adapter.
To ensure Unreal Engine Test Adapter is enabled properly, double check “Unreal Engine Test Adapter” is selected in the Visual Studio Installer under the “Game development with C++” workload. The latest version of our Unreal Engine plugin from the UE marketplace or GitHub is required.
After installing the UE Test Adapter, your Unreal Engine tests will automatically show up when you open Visual Studio. To see your tests, you can open Test Explorer. With the new Unreal Engine Test Adapter, you can easily run, manage, and debug your tests.
Build Insights Functions View
Build Insights is now integrated with Visual Studio 2022! In Visual Studio 2022 17.8 Preview 1, you can now see additional information relating to function generation. The new Functions View will provide you with how long a function takes during compilation as well as the number of ForceInlinees associated.
To ensure Build Insights is enabled properly, double check “C++ Build Insights” is selected in the Visual Studio Installer under “Desktop development with C++” or “Game development with C++” workloads.
Start your Build Insights .etl trace capture with the click of a button.
After compilation, Build Insights will create a diagnostic report that allows you to see function generation time as well as ForceInlinees.
We are committed to continually improving Build Insights. The current integration of Build Insights you see today represents only a fragment of what we have in store for you. Which workflows are important to you? Please let us know in this Developer Community Ticket.
Make member function const hints
You can now use this new feature that suggests making a member function const if it logically should not modify the object’s state. The use of const member functions is crucial for achieving const-correctness in C++ code. When a member function is declared as const, it can be safely invoked on const objects, enabling you to create const-correct code and avoid unexpected side effects when working with immutable objects.
One of the advantages of utilizing const member functions is the enhanced safety and predictability they bring to the codebase. By clearly distinguishing between functions that modify the object’s state and those that do not, it becomes easier to reason about the behavior of different member functions.
By hovering over a member function and clicking the light bulb icon, you can quickly access suggestions to mark the function as const.
By default, this feature is set as a suggestion, indicated by three dots below the function. To configure the setting, navigate to Tools > Options > Text Editor > C/C++ > Code Style > Linter.
Size and Alignment Hints
Size and alignment hints are now available in Visual Studio 2022 17.8 Preview 1. With this feature, you can effortlessly check the size and alignment of classes, structs, unions, base types, and enums right within your code editor, without the need to compile your code. When you hover over these elements, Quick Info will display their size and alignment information. You have the flexibility to hover over the names of classes, structs, or unions anywhere they appear in your code, not just at their declarations. This eliminates the need to scroll and search for their declarations, allowing you to effortlessly access their size and alignment information from any part of the codebase.
Debugging and Diagnostics
.NET Counters Tool in Debugging Scenario
The .NET Counter tool is now available within the diagnostics window now.
This means even during debugging sessions; you can still leverage the power of .NET Counters to monitor and analyze critical performance metrics. Simply Select the “.NET Counters” option under the “Select Tool” dropdown to enable it.
The tool’s seamless integration in both Performance Profiling and Debugging environments provides comprehensive insights and enhances their ability to optimize application performance effectively.
Code Action for Event Handler Method Generation
If you’re using an event like @onclick or @onactivate to reference a C# method that hasn’t been defined yet, you can use a new Razor code action to automatically generate that event handler method. This code action also supports custom event arguments.
Background Color for C# Code
For those who prefer it, you now have the option to add a background color for C# code located within Razor files. Turned off by default, enable this option by going to Tools > Options > Text Editor > Razor > Advanced and setting Background for C# Code to True.
New React TypeScript and ASP.NET Combined Templates
New IntelliTest now in Preview
IntelliTest explores your .NET code to generate test suites with high code coverage. Powered by the latest version of the Z3 problem solver, it generates a varied set of inputs (scoped to those that improve code coverage) that are then plugged into what we call parameterized unit tests for each of your methods. When you Generate Tests, you have the ability to select which tests you’d like to preserve into a test project that can serve as your regression suite. As your code is updated, you can rerun IntelliTest to keep the generated tests in sync with your code.
Previous implementations of this Enterprise Edition feature only supported code targeting .NET Framework and did not support x64 configuration. This updated version includes the following:
- Add IntelliTest support for .NET Core/Standard – Developer Community (visualstudio.com)
- Add IntelliTest support for x64 – Developer Community (visualstudio.com)
Give it a try on your projects today by enabling the feature through Tools > Manage Preview Features and selecting IntelliTest support for NetFx and Net6 using Z3 v4 (requires restart).
Then in your code, right click within a method and select IntelliTest (Preview) and either Create Project to create a project where your tests can be saved or Generate Tests to generate a set of tests to review and decide which ones to keep.
Share your feedback and stay connected with Visual Studio!
We appreciate the time you’ve spent reporting issues/suggestions and hope you continue to give us feedback when using Visual Studio on what you like and what we can improve. Your feedback is critical to help us make Visual Studio the best tool it can be! You can share feedback with us via Developer Community: report any bugs or issues via report a problem and share your suggestions for new features or improvements to existing ones.
On behalf of the whole Visual Studio team, thanks for reading and Happy Coding!