tomasr / viasfora

A Visual Studio Extension containing miscellaneous improvements to the editor.
Other
552 stars 89 forks source link

Suggestion: Rainbow Braces option: separate nesting per types #306

Open amirea opened 3 years ago

amirea commented 3 years ago

Hello and thank you for this project. Not just a polite thanks but a warm one. It goes a long way in code readability. It helps a lot.

About the suggestion, I noticed in my code some classes curly braces had all a color and other classes in other file had all another color. I found it awkward and a bit distracting. Then I realized the classes in the first case resided in a namespace.

So may I suggest adding an option so that nesting takes into account just the same brace type? This way, some confusion is avoided. For example: Say you have two algorithms with nested parentheses, very similar but one is inside a block and the other is inside a nested block. Comparing the algorithms is more difficult with 2 different sets of colors. Another side of the same issue: you get accustomed to how your code looks like, see a particular expression enclosed in green parentheses but the next day the green ones contain a larger expression because you moved the whole code into a block or class or namespace.

Another benefit of separate nesting is that nested parentheses which are the most nested occurrence is isolated, leaving the rest of the code neater.

Reading through the issues in this git I found out that some of them kind of relate:

Add support to color selected kinds of braces #293 If nesting is separate by type/kind, adding a enable/disable option for each would may be easier to implement?

Feature Request, C#: Provide option to disable brace matching at namespace/class level #204
Without using semantics, my suggestion would kind of alleviate much of the visual issue.

Can I disable rainbow coloring for square brackets? #278 This would be solved in the same manner as #293

tomasr commented 2 years ago

There's an "Rainbow Coring Mode == PerBrace" option. Would that maybe help here?