News

Visual Studio Devs Love New Brace Pair Colorization in v17.6 Preview 1

Brace pair colorization is a big hit with developers in the new Visual Studio 2022 v17.6 Preview 1, which borrowed the idea from its open-source-based cousin, Visual Studio Code.

Brace (or bracket) pair colorization was enabled by default in VS Code back in August 2022 "given the positive feedback of the new bracket pair colorization feature introduced in the 1.60 release."

At the same time, Microsoft extension guru Mads Kristensen provided the functionality in his Visual Studio tool, Rainbow Braces, used to colorize matching brace pairs to make it easy to identify them and their scope, working with curly brackets, parentheses and square brackets.

Bracket Pair Colorization
[Click on image for larger view.] Bracket Pair Colorization (source: Microsoft).

The idea sprang from a feature request in Microsoft's Developer Community site from Jody Koplo in January 2022. It garnered 431 upvotes and generated a robust discussion with 54 comments, still coming in a few days ago.

Initial functionality was introduced in v17.5 previews and was planned to be baked in to the recent GA release of Visual Studio 2022 17.5, but that didn't happen ("Unfortunately this has been delayed until 17.6"), instead appearing in last week's first preview of VS 2022 v17.6.

"You can now visually distinguish each set of opening and closing braces for your code making it easier to see your code's scope or find any missing braces," Microsoft announced today, Feb. 28.

Bracket Pair Colorization (VS Code Example)
[Click on image for larger view.] Bracket Pair Colorization (VS Code Example) (source: Microsoft).

After it first only worked with C++, code, brace pair colorization has been expanded to C#, TypeScript, JavaScript, Visual Basic and Razor, enabled by going to Tools > Options > Environment > Preview Features and checking "Enable Brace Pair Colorization."

"This is a feature I'm particularly happy to see since it's one I was originally introduced to by a neurodiverse developer named Mitch who had managed to hack this into VS through extensibility," last week said Microsoft's Dante Gagne, who gave credit to PM Dalia Abo Sheasha for driving it. "It's VERY powerful for folks with ADHD and it's something I've been wanting to see in the product proper for YEARS ... but it's just been difficult to get prioritized."

One Developer Community comment gave the feature high marks: "I'm trying them in Preview 17.6.0 P 1.0 and they work GREAT! Sometimes you need to re-close some marker (" } ) ) to trigger the UI, but feels great!"

Another big feature in Preview 1 is IntelliCode API usage examples for C#, which you can read about in the Visual Studio Magazine article, "Visual Studio IntelliCode Preview Offers Instant API Code Examples."

Other features include Git line unstaging and GitHub issue integration in the IDE productivity department, while the .NET space sees visualizers support for .NET remote debugging and .NET MAUI tooling for ARM64 devices. Several improvements were also listed for C++ gaming and C++ cross-platform functionality.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube