Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Underscore in Green _ ( not green squiggly)

Visual Studio 2013 frequently marks my code with a green _ ( green underscore bar).

enter image description here

What does it represent and is there a feature that it's linked to, like auto complete or intellisense ?

like image 597
Stephan Luis Avatar asked May 20 '15 08:05

Stephan Luis


1 Answers

This is the automatic brace completion feature that was introduced in Visual Studio 2013 (although, like so many new features in Visual Studio, it was actually in the Productivity Power Tools extension first).

When you write an opening brace, Visual Studio 2013 inserts a closing brace for you automatically. The underline simply indicates that the code editor is still in brace-complete mode. While in this mode, Visual Studio is waiting to see if you close the brace yourself, in which case it will remove the redundant brace and move the text cursor if necessary. While in this mode, you can also press tab to move the cursor past the closing brace; although, this only seems to work when both braces are on the same line and there is nothing (except whitespace) between the cursor and the closing brace. Moving the cursor outside of the braces exits this mode.

This feature works not only for braces, but also parentheses, square brackets, and quotes (single and double).

You can enable or disable this feature by checking or unchecking the Automatic brace completion checkbox located in:

Tools → Options → Text Editor → All Languages* → General

* or a specific language, e.g. C#

like image 164
Nacimota Avatar answered Sep 29 '22 04:09

Nacimota