News

Visual Studio Extension Guru Intros Rainbow Braces to Make Sense of Code

Visual Studio extension expert Mads Kristensen's latest creation is Rainbow Braces, used to colorize brace pairs in order to better understand nested code.

A principal program manager on Microsoft's Visual Studio dev team, Kristensen is known for his many extensions -- nearly 200 -- that add functionality to the company's flagship IDE.

Last week, he took to Twitter to announce Rainbow Braces, which was received with much developer enthusiasm because it "Colorizes matching brace pairs to make it easy to identify them and their scope. Works for curly brackets, parentheses, and square brackets."

Rainbow Braces
[Click on image for larger view.] Rainbow Braces (source: Kristensen/Twitter).

The new offering was inspired by a Jan. 6 feature request on the Developer Community site that read:

Bracket pair colorization is one of my favorite features in VS Code and now it's supported natively: https://code.visualstudio.com/blogs/2021/09/29/bracket-pair-colorization

I regularly use both VS Code and VS 2019/2022 and I would love to have this feature available in Visual Studio. Can we make that happen? Pretty please?

Apparently asking "Pretty Please?" did the trick of persuading Kristensen to author the Rainbow Braces extension last week. Many developers lauded the new tool, with one asking if it was possible to provide toggle on/off functionality, which Kristensen added along with other requested functionality in a quick update.

Kristensen said his take on a simple brace colorizer was inspired by the free Viasfora extension from Tomas Restrepo (374,218 installs), which lists "Rainbow Braces" among several other capabilities. When asked why developers shouldn't just use that tool, Kristensen replied that numerous people over the years have expressed a desire for a smaller extension that does nothing but rainbow bracing.

A commenter also found an advantage over Viasfora: "I just installed it [Kristensen's Rainbow Braces], thank you! I didn't like the way Viasfora changed the colours of other text without the ability to disable it."

As of this writing, Kristensen's announcement tweet has garnered 348 likes, 21 comments and 47 retweets, while the tool in the VS Marketplace has been installed 717 times since its Aug. 24 debut, earning a near-perfect 4.9 rating from 11 developers who reviewed and rated it. "Love it. As someone with partial color blindness and various other optical maladies, this helps a lot. Especially with long JSON declarations in appsettings.json," said one review.

Kristensen encouraged developers to vote for the original Developer Community request, which could increase the chances of Rainbow Braces becoming a native, baked-in feature.

The project is hosted on GitHub here.

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