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

  • Windows Community Toolkit v8.2 Adds Native AOT Support

    Microsoft shipped Windows Community Toolkit v8.2, an incremental update to the open-source collection of helper functions and other resources designed to simplify the development of Windows applications. The main new feature is support for native ahead-of-time (AOT) compilation.

  • New 'Visual Studio Hub' 1-Stop-Shop for GitHub Copilot Resources, More

    Unsurprisingly, GitHub Copilot resources are front-and-center in Microsoft's new Visual Studio Hub, a one-stop-shop for all things concerning your favorite IDE.

  • Mastering Blazor Authentication and Authorization

    At the Visual Studio Live! @ Microsoft HQ developer conference set for August, Rockford Lhotka will explain the ins and outs of authentication across Blazor Server, WebAssembly, and .NET MAUI Hybrid apps, and show how to use identity and claims to customize application behavior through fine-grained authorization.

  • Linear Support Vector Regression from Scratch Using C# with Evolutionary Training

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the linear support vector regression (linear SVR) technique, where the goal is to predict a single numeric value. A linear SVR model uses an unusual error/loss function and cannot be trained using standard simple techniques, and so evolutionary optimization training is used.

  • Low-Code Report Says AI Will Enhance, Not Replace DIY Dev Tools

    Along with replacing software developers and possibly killing humanity, advanced AI is seen by many as a death knell for the do-it-yourself, low-code/no-code tooling industry, but a new report belies that notion.

Subscribe on YouTube