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

  • 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