BLOG.CSHARPHELPER.COM: Tip: Make parentheses matching more visible in C#
Tip: Make parentheses matching more visible in C#
Recently someone asked me if there was a Visual Studio add-in that highlighted parentheses, brackets, and braces so it would be easier to tell which closing parenthesis matched which opening parenthesis. (By the way, if you have a question, email me. If I think a lot of people would benefit from the answer, I'll post it. Even if I think the question is too specific, I'll try to point you in the right direction if I can.)
It turns out that Visual Studio already has a feature like this. When you place the cursor after a closing parenthesis (for example, the cursor is there right after you type the character), Visual Studio highlights that parenthesis and the matching opening parenthesis. By default the highlighting is light gray so it's not easy to see, but if you take the following steps you can make it much more obvious.
In the Tools menu, select Options
In the Options dialog, open the Environment folder and select Fonts and Colors
Change "Brace Matching (Rectangle)" to the color you want to use for the highlight. For example, try Yellow or Lime.
Now it will be obvious which opening parenthesis matches a closing parenthesis.
There's also a nice extension named Indent Guides (http://visualstudiogallery.msdn.microsoft.com/e792686d-542b-474a-8c55-630980e72c30) that draws dotted lines between them - I find that quite useful too.
Reply to this