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 for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube