This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Visual Studio
VS 2010+

Visual Studio 2010 Intellisense Modes

Visual Studio 2010 includes some improvements to Intellisense. One new feature is the inclusion of two modes of operation. These are the original Intellisense completion mode and the new suggestion mode, which is ideal for test-driven development.

Intellisense Completion Mode

The default type of Intellisense is Intellisense Completion Mode. This behaves in a similar manner to that of previous Visual Studio versions. When you begin typing the name of a token, such as a class, structure, method or property name, a list of existing items is displayed. The list includes tokens that contain the typed text or where the entered characters match the Pascal case initials of the token.

When the list is visible, an item is always selected. If you press certain keys, such as space, tab, enter or the full stop character (period), the selected item is inserted into your code automatically. You can also select a suggestion from the list to have it added to your code.

The image below shows an example Intellisense list. Here the programmer has typed "Act" and a list of possible items has been displayed. "ActivationContext" is selected as the item that will be automatically inserted.

Visual Studio 2010 Intellisense Completion Mode

Intellisense Suggestion Mode

With practise, Intellisense completion mode allows you to edit your code more quickly and improve your productivity. However, there is a drawback. If you are a practitioner of test-driven development you will often need to enter undefined names as you create your tests. In completion mode you may find that Visual Studio replaces these names.

Intellisense Suggestion Mode removes the automatic completion of token names when pressing space and other keys. As with completion mode, suggestions are displayed in a list as you type. The first item in the list is the text that you have actually entered. When you press the space bar, the current text is unaffected and a space is added. If you wish to use automatic completion, you can select an item from the list using the mouse or the arrow keys.

The image below shows the list of suggestions for the text, "Act", when using Intellisense Suggestion Mode. All of the previous items are present, as is an extra item that matches the typed text.

Visual Studio 2010 Intellisense Suggestion Mode

Switching Between Intellisense Modes

To switch between the two modes you can open the Edit menu, select the Intellisense submenu and click "Toggle Completion Mode". If you switch modes often, you may find it quicker to use the keyboard shortcut, Ctrl-Alt-Space.

17 January 2011