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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events