Datasheet
The following table describes some of the default colors that the code editor uses to highlight different
code elements.
Item Highlighting
Comment Green text
Compiler error Underlined with a wavy blue underline
Other error Underlined with a wavy green underline
Keyword Blue text
Preprocessor keyword Blue text
Read-only region Light gray background
Stale code Purple text
User types Navy text
User types, delegates Navy text
User types, enums Teal text
User types, interfaces Navy text
User types, value types Teal text
Warning Underlined with a wavy purple underline
A few other items that may be worth changing have white backgrounds and black text by default. These
include identifiers (variable names, types, object properties and methods, namespace names, and so
forth), numbers, and strings.
When the code editor finds an error in your code, it highlights the error with a wavy underline. If you
hover over the underline, the editor displays a tooltip describing the error. If Visual Studio can guess
what you are trying to do, it adds a small flat rectangle to the end of the wavy error line to indicate that
it may have useful suggestions.
The assignment statement
i = “12” shown in Figure 1-59 has an error because it tried to assign a string
value to an integer variable and that violates the Option Strict On setting. The editor displays the wavy
error underline and a suggestion indicator because it knows a way to fix this error.
If you hover over the suggestion indicator, the editor displays a tooltip describing the problem and an
error icon. If you click the icon, Visual Studio displays a dialog describing the error and listing the
actions that you may want to take. Figure 1-60 shows the suggestion dialog for the error in Figure 1-59. If
you click the text over the revised sample code, or if you double-click the sample code, the editor makes
the change.
59
IDE
571982 ch01_2.qxd 1/19/06 1:16 PM Page 59