VS 2010: Enhanced IntelliSense Matching

Posted Tue, Apr 6 2010 23:27 by Deborah Kurata

One of the features of Visual Studio that really helps with programming productivity is IntelliSense. The IntelliSense List Members feature not only provides lists of valid members, it also short-cuts your typing of those members. And now with VS 2010, it is even better.

Here is an example of the Intellisense List Members using VS 2008.

In C#:

image

In VB:

image

Simply typing .R (or even .r) picks up the Retrieve method. Then you can press the tab key to select the highlighted entry. Or to save even more keystrokes, just type "(" to select the highlighted entry and continue the method call.

But what if you wanted to call the RetrieveById method? Then you had some more typing to do or arrow keys to press.

This is where Visual Studio 2010 Intellisense has been significantly improved. Now you can simply type "RB" to pick the RetrieveById method from the list.

NOTE: The letters must be capitalized.

Here is an example.

In C#:

image

In VB:

image

Then you can again press the tab key to select the highlighted entry. Or just type "(" to select the highlighted entry and continue the method call.

This ability to match is based on the Pascal casing of the member, which is a naming convention whereby each word in the member starts with a capital letter. (Here is yet another reason to get your team to follow good naming conventions!)

But this technique also works with camel casing (where each word starts with a capital letter except the first one, e.g. currentIndex), and with underscores (e.g. Retrieve_By_Id).

Another new feature in the IntelliSense List Members is "contains" style matching instead of "starts with" style matching. So if in the above example, there were other methods, such as AddressRetrieve and AddressRetrieveById, they would appear when searching for retrieve.

In C#:

image

In VB:

image

Use this technique to quickly find and select the desired members.

Enjoy!

Filed under: , , , ,

Comments

# Daily tech links for .net and related technologies - Apr 8-10, 2010

Thursday, April 08, 2010 1:30 AM by Sanjeev Agarwal

Daily tech links for .net and related technologies - Apr 8-10, 2010 Web Development Using RIA DomainServices

# re: VS 2010: Enhanced IntelliSense Matching

Tuesday, June 08, 2010 2:22 PM by sandeep jakhotya

The "contains" style matching instead of "starts with" style matching is really very goods feature that have been added.

Is this maching also works with Input Controls like ComboBox and AutoComplete enabled TextBox too in VS 2010 ?

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: