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 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