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

  • New 'Visual Studio Hub' 1-Stop-Shop for GitHub Copilot Resources, More

    Unsurprisingly, GitHub Copilot resources are front-and-center in Microsoft's new Visual Studio Hub, a one-stop-shop for all things concerning your favorite IDE.

  • Mastering Blazor Authentication and Authorization

    At the Visual Studio Live! @ Microsoft HQ developer conference set for August, Rockford Lhotka will explain the ins and outs of authentication across Blazor Server, WebAssembly, and .NET MAUI Hybrid apps, and show how to use identity and claims to customize application behavior through fine-grained authorization.

  • Linear Support Vector Regression from Scratch Using C# with Evolutionary Training

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the linear support vector regression (linear SVR) technique, where the goal is to predict a single numeric value. A linear SVR model uses an unusual error/loss function and cannot be trained using standard simple techniques, and so evolutionary optimization training is used.

  • Low-Code Report Says AI Will Enhance, Not Replace DIY Dev Tools

    Along with replacing software developers and possibly killing humanity, advanced AI is seen by many as a death knell for the do-it-yourself, low-code/no-code tooling industry, but a new report belies that notion.

  • Vibe Coding with Latest Visual Studio Preview

    Microsoft's latest Visual Studio preview facilitates "vibe coding," where developers mainly use GitHub Copilot AI to do all the programming in accordance with spoken or typed instructions.

Subscribe on YouTube