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

Subscribe on YouTube